php-cs-fixer
parent
dc2f201152
commit
a245c4618b
|
@ -125,6 +125,7 @@ class BaseDependencyCommand extends BaseCommand
|
||||||
} else {
|
} else {
|
||||||
$this->printTable($output, $results);
|
$this->printTable($output, $results);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,13 +142,13 @@ class BaseDependencyCommand extends BaseCommand
|
||||||
do {
|
do {
|
||||||
$queue = array();
|
$queue = array();
|
||||||
$rows = array();
|
$rows = array();
|
||||||
foreach($results as $result) {
|
foreach ($results as $result) {
|
||||||
/**
|
/**
|
||||||
* @var PackageInterface $package
|
* @var PackageInterface $package
|
||||||
* @var Link $link
|
* @var Link $link
|
||||||
*/
|
*/
|
||||||
list($package, $link, $children) = $result;
|
list($package, $link, $children) = $result;
|
||||||
$unique = (string)$link;
|
$unique = (string) $link;
|
||||||
if (isset($doubles[$unique])) {
|
if (isset($doubles[$unique])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -158,7 +159,7 @@ class BaseDependencyCommand extends BaseCommand
|
||||||
}
|
}
|
||||||
$results = $queue;
|
$results = $queue;
|
||||||
$table = array_merge($rows, $table);
|
$table = array_merge($rows, $table);
|
||||||
} while(!empty($results));
|
} while (!empty($results));
|
||||||
|
|
||||||
// Render table
|
// Render table
|
||||||
$renderer = new Table($output);
|
$renderer = new Table($output);
|
||||||
|
@ -178,7 +179,7 @@ class BaseDependencyCommand extends BaseCommand
|
||||||
{
|
{
|
||||||
$count = count($results);
|
$count = count($results);
|
||||||
$idx = 0;
|
$idx = 0;
|
||||||
foreach($results as $key => $result) {
|
foreach ($results as $key => $result) {
|
||||||
/**
|
/**
|
||||||
* @var PackageInterface $package
|
* @var PackageInterface $package
|
||||||
* @var Link $link
|
* @var Link $link
|
||||||
|
|
|
@ -93,7 +93,7 @@ EOT
|
||||||
throw new \RuntimeException('Timeout value must be numeric and positive if defined, or 0 for forever');
|
throw new \RuntimeException('Timeout value must be numeric and positive if defined, or 0 for forever');
|
||||||
}
|
}
|
||||||
// Override global timeout set before in Composer by environment or config
|
// Override global timeout set before in Composer by environment or config
|
||||||
ProcessExecutor::setTimeout((int)$timeout);
|
ProcessExecutor::setTimeout((int) $timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $composer->getEventDispatcher()->dispatchScript($script, $input->getOption('dev') || !$input->getOption('no-dev'), $args);
|
return $composer->getEventDispatcher()->dispatchScript($script, $input->getOption('dev') || !$input->getOption('no-dev'), $args);
|
||||||
|
|
|
@ -16,7 +16,6 @@ use Composer\Factory;
|
||||||
use Composer\Package\Loader\ValidatingArrayLoader;
|
use Composer\Package\Loader\ValidatingArrayLoader;
|
||||||
use Composer\Plugin\CommandEvent;
|
use Composer\Plugin\CommandEvent;
|
||||||
use Composer\Plugin\PluginEvents;
|
use Composer\Plugin\PluginEvents;
|
||||||
use Composer\Script\ScriptEvents;
|
|
||||||
use Composer\Util\ConfigValidator;
|
use Composer\Util\ConfigValidator;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
|
|
@ -59,7 +59,6 @@ class PathDownloader extends FileDownloader
|
||||||
// Implement symlinks as NTFS junctions on Windows
|
// Implement symlinks as NTFS junctions on Windows
|
||||||
$this->filesystem->junction($realUrl, $path);
|
$this->filesystem->junction($realUrl, $path);
|
||||||
$this->io->writeError(sprintf(' Junctioned from %s', $url));
|
$this->io->writeError(sprintf(' Junctioned from %s', $url));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$shortestPath = $this->filesystem->findShortestPath($path, $realUrl);
|
$shortestPath = $this->filesystem->findShortestPath($path, $realUrl);
|
||||||
$fileSystem->symlink($shortestPath, $path);
|
$fileSystem->symlink($shortestPath, $path);
|
||||||
|
|
|
@ -30,7 +30,6 @@ use Composer\Installer\InstallationManager;
|
||||||
use Composer\Installer\InstallerEvents;
|
use Composer\Installer\InstallerEvents;
|
||||||
use Composer\Installer\NoopInstaller;
|
use Composer\Installer\NoopInstaller;
|
||||||
use Composer\IO\IOInterface;
|
use Composer\IO\IOInterface;
|
||||||
use Composer\Json\JsonFile;
|
|
||||||
use Composer\Package\AliasPackage;
|
use Composer\Package\AliasPackage;
|
||||||
use Composer\Package\CompletePackage;
|
use Composer\Package\CompletePackage;
|
||||||
use Composer\Package\Link;
|
use Composer\Package\Link;
|
||||||
|
@ -40,7 +39,6 @@ use Composer\Package\PackageInterface;
|
||||||
use Composer\Package\RootPackageInterface;
|
use Composer\Package\RootPackageInterface;
|
||||||
use Composer\Repository\CompositeRepository;
|
use Composer\Repository\CompositeRepository;
|
||||||
use Composer\Repository\InstalledArrayRepository;
|
use Composer\Repository\InstalledArrayRepository;
|
||||||
use Composer\Repository\InstalledFilesystemRepository;
|
|
||||||
use Composer\Repository\PlatformRepository;
|
use Composer\Repository\PlatformRepository;
|
||||||
use Composer\Repository\RepositoryInterface;
|
use Composer\Repository\RepositoryInterface;
|
||||||
use Composer\Repository\RepositoryManager;
|
use Composer\Repository\RepositoryManager;
|
||||||
|
|
|
@ -23,12 +23,12 @@ class PharArchiver implements ArchiverInterface
|
||||||
'zip' => \Phar::ZIP,
|
'zip' => \Phar::ZIP,
|
||||||
'tar' => \Phar::TAR,
|
'tar' => \Phar::TAR,
|
||||||
'tar.gz' => \Phar::TAR,
|
'tar.gz' => \Phar::TAR,
|
||||||
'tar.bz2' => \Phar::TAR
|
'tar.bz2' => \Phar::TAR,
|
||||||
);
|
);
|
||||||
|
|
||||||
protected static $compressFormats = array(
|
protected static $compressFormats = array(
|
||||||
'tar.gz' => \Phar::GZ,
|
'tar.gz' => \Phar::GZ,
|
||||||
'tar.bz2' => \Phar::BZ2
|
'tar.bz2' => \Phar::BZ2,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,7 +20,7 @@ use ZipArchive;
|
||||||
class ZipArchiver implements ArchiverInterface
|
class ZipArchiver implements ArchiverInterface
|
||||||
{
|
{
|
||||||
protected static $formats = array(
|
protected static $formats = array(
|
||||||
'zip' => 1
|
'zip' => 1,
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -33,7 +33,7 @@ class ZipArchiver implements ArchiverInterface
|
||||||
$res = $zip->open($target, ZipArchive::CREATE);
|
$res = $zip->open($target, ZipArchive::CREATE);
|
||||||
if ($res === true) {
|
if ($res === true) {
|
||||||
$files = new ArchivableFilesFinder($sources, $excludes);
|
$files = new ArchivableFilesFinder($sources, $excludes);
|
||||||
foreach($files as $file) {
|
foreach ($files as $file) {
|
||||||
/** @var $file \SplFileInfo */
|
/** @var $file \SplFileInfo */
|
||||||
$filepath = $file->getPath()."/".$file->getFilename();
|
$filepath = $file->getPath()."/".$file->getFilename();
|
||||||
$localname = str_replace($sources."/", '', $filepath);
|
$localname = str_replace($sources."/", '', $filepath);
|
||||||
|
@ -59,7 +59,8 @@ class ZipArchiver implements ArchiverInterface
|
||||||
return isset(static::$formats[$format]) && $this->compressionAvailable();
|
return isset(static::$formats[$format]) && $this->compressionAvailable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function compressionAvailable() {
|
private function compressionAvailable()
|
||||||
|
{
|
||||||
return class_exists('ZipArchive');
|
return class_exists('ZipArchive');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ use Composer\Config;
|
||||||
use Composer\IO\IOInterface;
|
use Composer\IO\IOInterface;
|
||||||
use Composer\Json\JsonFile;
|
use Composer\Json\JsonFile;
|
||||||
use Composer\Package\Loader\ArrayLoader;
|
use Composer\Package\Loader\ArrayLoader;
|
||||||
use Composer\Package\Locker;
|
|
||||||
use Composer\Package\Version\VersionGuesser;
|
use Composer\Package\Version\VersionGuesser;
|
||||||
use Composer\Package\Version\VersionParser;
|
use Composer\Package\Version\VersionParser;
|
||||||
use Composer\Util\ProcessExecutor;
|
use Composer\Util\ProcessExecutor;
|
||||||
|
|
|
@ -620,6 +620,7 @@ class Filesystem
|
||||||
}
|
}
|
||||||
// Junctions have no link stat but are otherwise indistinguishable from real directories
|
// Junctions have no link stat but are otherwise indistinguishable from real directories
|
||||||
$stat = lstat($junction);
|
$stat = lstat($junction);
|
||||||
|
|
||||||
return ($stat['mode'] === 0);
|
return ($stat['mode'] === 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -639,6 +640,7 @@ class Filesystem
|
||||||
throw new IOException(sprintf('%s is not a junction and thus cannot be removed as one', $junction));
|
throw new IOException(sprintf('%s is not a junction and thus cannot be removed as one', $junction));
|
||||||
}
|
}
|
||||||
$cmd = sprintf('rmdir /S /Q %s', ProcessExecutor::escape($junction));
|
$cmd = sprintf('rmdir /S /Q %s', ProcessExecutor::escape($junction));
|
||||||
|
|
||||||
return ($this->getProcess()->execute($cmd, $output) === 0);
|
return ($this->getProcess()->execute($cmd, $output) === 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
/*
|
||||||
* This file is part of Composer.
|
* This file is part of Composer.
|
||||||
*
|
*
|
||||||
* (c) Nils Adermann <naderman@naderman.de>
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
|
|
|
@ -16,7 +16,6 @@ use Composer\Package\Archiver\ZipArchiver;
|
||||||
|
|
||||||
class ZipArchiverTest extends ArchiverTest
|
class ZipArchiverTest extends ArchiverTest
|
||||||
{
|
{
|
||||||
|
|
||||||
public function testZipArchive()
|
public function testZipArchive()
|
||||||
{
|
{
|
||||||
if (!class_exists('ZipArchive')) {
|
if (!class_exists('ZipArchive')) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
|
/*
|
||||||
* This file is part of Composer.
|
* This file is part of Composer.
|
||||||
*
|
*
|
||||||
* (c) Nils Adermann <naderman@naderman.de>
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
|
|
Loading…
Reference in New Issue