Jordi Boggiano vor 10 Jahren
Ursprung
Commit
94926218e8
56 geänderte Dateien mit 94 neuen und 123 gelöschten Zeilen
  1. 2 5
      src/Composer/Autoload/AutoloadGenerator.php
  2. 2 2
      src/Composer/Cache.php
  3. 0 1
      src/Composer/Command/AboutCommand.php
  4. 0 1
      src/Composer/Command/ArchiveCommand.php
  5. 2 0
      src/Composer/Command/ClearCacheCommand.php
  6. 2 2
      src/Composer/Command/ConfigCommand.php
  7. 0 1
      src/Composer/Command/CreateProjectCommand.php
  8. 4 7
      src/Composer/Command/HomeCommand.php
  9. 3 4
      src/Composer/Command/InitCommand.php
  10. 1 1
      src/Composer/Command/InstallCommand.php
  11. 1 1
      src/Composer/Command/RemoveCommand.php
  12. 1 1
      src/Composer/Command/RequireCommand.php
  13. 1 1
      src/Composer/Command/UpdateCommand.php
  14. 1 1
      src/Composer/Config/JsonConfigSource.php
  15. 2 3
      src/Composer/Console/Application.php
  16. 1 1
      src/Composer/DependencyResolver/Pool.php
  17. 0 4
      src/Composer/DependencyResolver/Solver.php
  18. 0 2
      src/Composer/DependencyResolver/Transaction.php
  19. 1 1
      src/Composer/Downloader/ArchiveDownloader.php
  20. 1 1
      src/Composer/Downloader/FileDownloader.php
  21. 11 10
      src/Composer/Downloader/PearPackageExtractor.php
  22. 3 3
      src/Composer/EventDispatcher/Event.php
  23. 12 13
      src/Composer/EventDispatcher/EventDispatcher.php
  24. 6 6
      src/Composer/Factory.php
  25. 3 3
      src/Composer/Installer.php
  26. 0 1
      src/Composer/Installer/PluginInstaller.php
  27. 2 2
      src/Composer/Json/JsonFile.php
  28. 1 1
      src/Composer/Json/JsonManipulator.php
  29. 0 1
      src/Composer/Package/LinkConstraint/SpecificConstraint.php
  30. 1 1
      src/Composer/Package/Loader/ArrayLoader.php
  31. 1 1
      src/Composer/Package/Locker.php
  32. 4 2
      src/Composer/Package/Version/VersionParser.php
  33. 4 3
      src/Composer/Package/Version/VersionSelector.php
  34. 1 1
      src/Composer/Repository/ArtifactRepository.php
  35. 2 2
      src/Composer/Repository/Pear/PackageDependencyParser.php
  36. 1 1
      src/Composer/Repository/Vcs/GitDriver.php
  37. 0 1
      src/Composer/Repository/Vcs/PerforceDriver.php
  38. 0 1
      src/Composer/Repository/Vcs/SvnDriver.php
  39. 1 1
      src/Composer/Util/NoProxyPattern.php
  40. 0 1
      src/Composer/Util/Perforce.php
  41. 4 4
      src/Composer/Util/ProcessExecutor.php
  42. 0 1
      src/Composer/Util/Svn.php
  43. 1 1
      tests/Composer/Test/Autoload/ClassLoaderTest.php
  44. 0 1
      tests/Composer/Test/Config/JsonConfigSourceTest.php
  45. 1 2
      tests/Composer/Test/DependencyResolver/SolverTest.php
  46. 7 7
      tests/Composer/Test/Downloader/PearPackageExtractorTest.php
  47. 0 1
      tests/Composer/Test/Downloader/PerforceDownloaderTest.php
  48. 1 1
      tests/Composer/Test/InstallerTest.php
  49. 0 1
      tests/Composer/Test/Json/JsonFileTest.php
  50. 0 1
      tests/Composer/Test/Json/JsonFormatterTest.php
  51. 0 1
      tests/Composer/Test/Mock/RemoteFilesystemMock.php
  52. 0 1
      tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php
  53. 1 1
      tests/Composer/Test/Plugin/PluginInstallerTest.php
  54. 0 2
      tests/Composer/Test/Repository/ArtifactRepositoryTest.php
  55. 1 2
      tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php
  56. 0 1
      tests/Composer/Test/Util/PerforceTest.php

+ 2 - 5
src/Composer/Autoload/AutoloadGenerator.php

@@ -54,7 +54,7 @@ class AutoloadGenerator
     public function dump(Config $config, InstalledRepositoryInterface $localRepo, PackageInterface $mainPackage, InstallationManager $installationManager, $targetDir, $scanPsr0Packages = false, $suffix = '')
     {
         $this->eventDispatcher->dispatchScript(ScriptEvents::PRE_AUTOLOAD_DUMP, $this->devMode, array(), array(
-            'optimize' => (bool) $scanPsr0Packages
+            'optimize' => (bool) $scanPsr0Packages,
         ));
 
         $filesystem = new Filesystem();
@@ -255,7 +255,7 @@ EOF;
 
             $packageMap[] = array(
                 $package,
-                $installationManager->getInstallPath($package)
+                $installationManager->getInstallPath($package),
             );
         }
 
@@ -533,7 +533,6 @@ INCLUDEPATH;
 
 
 REGISTER_AUTOLOAD;
-
         }
 
         $file .= <<<REGISTER_LOADER
@@ -551,7 +550,6 @@ REGISTER_LOADER;
 
 
 INCLUDE_FILES;
-
         }
 
         $file .= <<<METHOD_FOOTER
@@ -571,7 +569,6 @@ function composerRequire$suffix(\$file)
 }
 
 FOOTER;
-
     }
 
     protected function parseAutoloadsType(array $packageMap, $type, PackageInterface $mainPackage)

+ 2 - 2
src/Composer/Cache.php

@@ -85,7 +85,7 @@ class Cache
 
             try {
                 return file_put_contents($this->root . $file, $contents);
-            } catch(\ErrorException $e) {
+            } catch (\ErrorException $e) {
                 if (preg_match('{^file_put_contents\(\): Only ([0-9]+) of ([0-9]+) bytes written}', $e->getMessage(), $m)) {
                     // Remove partial file.
                     unlink($this->root . $file);
@@ -150,7 +150,7 @@ class Cache
 
     public function gcIsNecessary()
     {
-       return (!self::$cacheCollected && !mt_rand(0, 50));
+        return (!self::$cacheCollected && !mt_rand(0, 50));
     }
 
     public function remove($file)

+ 0 - 1
src/Composer/Command/AboutCommand.php

@@ -40,6 +40,5 @@ EOT
 See http://getcomposer.org/ for more information.</comment>
 EOT
         );
-
     }
 }

+ 0 - 1
src/Composer/Command/ArchiveCommand.php

@@ -15,7 +15,6 @@ namespace Composer\Command;
 use Composer\Factory;
 use Composer\IO\IOInterface;
 use Composer\DependencyResolver\Pool;
-use Composer\Package\LinkConstraint\VersionConstraint;
 use Composer\Repository\CompositeRepository;
 use Composer\Script\ScriptEvents;
 use Composer\Plugin\CommandEvent;

+ 2 - 0
src/Composer/Command/ClearCacheCommand.php

@@ -52,11 +52,13 @@ EOT
             $cachePath = realpath($cachePath);
             if (!$cachePath) {
                 $io->write("<info>Cache directory does not exist ($key): $cachePath</info>");
+
                 return;
             }
             $cache = new Cache($io, $cachePath);
             if (!$cache->isEnabled()) {
                 $io->write("<info>Cache is not enabled ($key): $cachePath</info>");
+
                 return;
             }
 

+ 2 - 2
src/Composer/Command/ConfigCommand.php

@@ -160,7 +160,7 @@ EOT
             }
 
             $file = $input->getOption('auth') ? $this->authConfigFile->getPath() : $this->configFile->getPath();
-            system($editor . ' ' . $file . (defined('PHP_WINDOWS_VERSION_BUILD') ? '':  ' > `tty`'));
+            system($editor . ' ' . $file . (defined('PHP_WINDOWS_VERSION_BUILD') ? '' : ' > `tty`'));
 
             return 0;
         }
@@ -359,7 +359,7 @@ EOT
         );
 
         foreach ($uniqueConfigValues as $name => $callbacks) {
-             if ($settingKey === $name) {
+            if ($settingKey === $name) {
                 if ($input->getOption('unset')) {
                     return $this->configSource->removeConfigSetting($settingKey);
                 }

+ 0 - 1
src/Composer/Command/CreateProjectCommand.php

@@ -322,7 +322,6 @@ EOT
         return new InstallationManager();
     }
 
-
     /**
      * Updated preferSource or preferDist based on the preferredInstall config option
      * @param Config         $config

+ 4 - 7
src/Composer/Command/HomeCommand.php

@@ -15,7 +15,6 @@ namespace Composer\Command;
 use Composer\DependencyResolver\Pool;
 use Composer\Factory;
 use Composer\Package\CompletePackageInterface;
-use Composer\Package\Loader\InvalidPackageException;
 use Composer\Repository\CompositeRepository;
 use Composer\Repository\RepositoryInterface;
 use Composer\Util\ProcessExecutor;
@@ -23,7 +22,6 @@ use Symfony\Component\Console\Input\InputArgument;
 use Symfony\Component\Console\Input\InputOption;
 use Symfony\Component\Console\Input\InputInterface;
 use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Process\Exception\InvalidArgumentException;
 
 /**
  * @author Robert Schönthal <seroscho@googlemail.com>
@@ -92,8 +90,8 @@ EOT
     /**
      * finds a package by name
      *
-     * @param  RepositoryInterface $repos
-     * @param  string              $name
+     * @param  RepositoryInterface      $repos
+     * @param  string                   $name
      * @return CompletePackageInterface
      */
     protected function getPackage(RepositoryInterface $repos, $name)
@@ -142,8 +140,8 @@ EOT
     /**
      * initializes the repo
      *
-     * @param InputInterface  $input
-     * @param OutputInterface $output
+     * @param  InputInterface      $input
+     * @param  OutputInterface     $output
      * @return CompositeRepository
      */
     private function initializeRepo(InputInterface $input, OutputInterface $output)
@@ -159,5 +157,4 @@ EOT
 
         return $repo;
     }
-
 }

+ 3 - 4
src/Composer/Command/InitCommand.php

@@ -105,7 +105,7 @@ EOT
         }
 
         if (isset($options['require-dev'])) {
-            $options['require-dev'] = $this->formatRequirements($options['require-dev']) ;
+            $options['require-dev'] = $this->formatRequirements($options['require-dev']);
             if (array() === $options['require-dev']) {
                 $options['require-dev'] = new \stdClass;
             }
@@ -311,7 +311,6 @@ EOT
 
             foreach ($requires as $requirement) {
                 if (!isset($requirement['version'])) {
-
                     // determine the best version automatically
                     $version = $this->findBestVersionForPackage($input, $requirement['name']);
                     $requirement['version'] = $version;
@@ -553,8 +552,8 @@ EOT
      *
      * This returns a version with the ~ operator prefixed when possible.
      *
-     * @param  InputInterface $input
-     * @param  string         $name
+     * @param  InputInterface            $input
+     * @param  string                    $name
      * @return string
      * @throws \InvalidArgumentException
      */

+ 1 - 1
src/Composer/Command/InstallCommand.php

@@ -115,7 +115,7 @@ EOT
             ->setDevMode(!$input->getOption('no-dev'))
             ->setRunScripts(!$input->getOption('no-scripts'))
             ->setOptimizeAutoloader($optimize)
-            ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'));
+            ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
         ;
 
         if ($input->getOption('no-plugins')) {

+ 1 - 1
src/Composer/Command/RemoveCommand.php

@@ -104,7 +104,7 @@ EOT
             ->setDevMode($updateDevMode)
             ->setUpdate(true)
             ->setUpdateWhitelist($packages)
-            ->setWhitelistDependencies($input->getOption('update-with-dependencies'));
+            ->setWhitelistDependencies($input->getOption('update-with-dependencies'))
         ;
 
         $status = $install->run();

+ 1 - 1
src/Composer/Command/RequireCommand.php

@@ -130,7 +130,7 @@ EOT
             ->setDevMode($updateDevMode)
             ->setUpdate(true)
             ->setUpdateWhitelist(array_keys($requirements))
-            ->setWhitelistDependencies($input->getOption('update-with-dependencies'));
+            ->setWhitelistDependencies($input->getOption('update-with-dependencies'))
         ;
 
         $status = $install->run();

+ 1 - 1
src/Composer/Command/UpdateCommand.php

@@ -120,7 +120,7 @@ EOT
             ->setUpdate(true)
             ->setUpdateWhitelist($input->getOption('lock') ? array('lock') : $input->getArgument('packages'))
             ->setWhitelistDependencies($input->getOption('with-dependencies'))
-            ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'));
+            ->setIgnorePlatformRequirements($input->getOption('ignore-platform-reqs'))
         ;
 
         if ($input->getOption('no-plugins')) {

+ 1 - 1
src/Composer/Config/JsonConfigSource.php

@@ -187,7 +187,7 @@ class JsonConfigSource implements ConfigSourceInterface
     private function arrayUnshiftRef(&$array, &$value)
     {
         $return = array_unshift($array, '');
-        $array[0] =& $value;
+        $array[0] = &$value;
 
         return $return;
     }

+ 2 - 3
src/Composer/Console/Application.php

@@ -25,7 +25,6 @@ use Composer\Factory;
 use Composer\IO\IOInterface;
 use Composer\IO\ConsoleIO;
 use Composer\Json\JsonValidationException;
-use Composer\Json\JsonFile;
 use Composer\Util\ErrorHandler;
 
 /**
@@ -180,7 +179,8 @@ class Application extends BaseApplication
                     $output->writeln('<error>The disk hosting '.$dir.' is full, this may be the cause of the following exception</error>');
                 }
             }
-        } catch (\Exception $e) {}
+        } catch (\Exception $e) {
+        }
 
         return parent::renderException($exception, $output);
     }
@@ -206,7 +206,6 @@ class Application extends BaseApplication
                 $message = $e->getMessage() . ':' . PHP_EOL . $errors;
                 throw new JsonValidationException($message);
             }
-
         }
 
         return $this->composer;

+ 1 - 1
src/Composer/DependencyResolver/Pool.php

@@ -232,7 +232,7 @@ class Pool
      *                                                packages must match or null to return all
      * @param  bool                    $mustMatchName Whether the name of returned packages
      *                                                must match the given name
-     * @return PackageInterface[]                    A set of packages
+     * @return PackageInterface[]      A set of packages
      */
     public function whatProvides($name, LinkConstraintInterface $constraint = null, $mustMatchName = false)
     {

+ 0 - 4
src/Composer/DependencyResolver/Solver.php

@@ -83,7 +83,6 @@ class Solver
             $conflict = $this->decisions->decisionRule($literal);
 
             if ($conflict && RuleSet::TYPE_PACKAGE === $conflict->getType()) {
-
                 $problem = new Problem($this->pool);
 
                 $problem->addRule($rule);
@@ -609,7 +608,6 @@ class Solver
         $installedPos = 0;
 
         while (true) {
-
             if (1 === $level) {
                 $conflictRule = $this->propagate($level);
                 if (null !== $conflictRule) {
@@ -658,7 +656,6 @@ class Solver
                         }
 
                         if ($noneSatisfied && count($decisionQueue)) {
-
                             $oLevel = $level;
                             $level = $this->selectAndInstall($level, $decisionQueue, $disableRules, $rule);
 
@@ -742,7 +739,6 @@ class Solver
 
             // minimization step
             if (count($this->branches)) {
-
                 $lastLiteral = null;
                 $lastLevel = null;
                 $lastBranchIndex = 0;

+ 0 - 2
src/Composer/DependencyResolver/Transaction.php

@@ -55,7 +55,6 @@ class Transaction
 
             if ($literal > 0) {
                 if (isset($installMeansUpdateMap[abs($literal)]) && !$package instanceof AliasPackage) {
-
                     $source = $installMeansUpdateMap[abs($literal)];
 
                     $updateMap[$package->getId()] = array(
@@ -88,7 +87,6 @@ class Transaction
                     'package' => $package,
                     'reason' => $reason,
                 );
-
             }
         }
 

+ 1 - 1
src/Composer/Downloader/ArchiveDownloader.php

@@ -137,7 +137,7 @@ abstract class ArchiveDownloader extends FileDownloader
     /**
      * Returns the folder content, excluding dotfiles
      *
-     * @param string $dir Directory
+     * @param  string         $dir Directory
      * @return \SplFileInfo[]
      */
     private function getFolderContent($dir)

+ 1 - 1
src/Composer/Downloader/FileDownloader.php

@@ -101,7 +101,7 @@ class FileDownloader implements DownloaderInterface
                 }
             }
         }
-        
+
         $this->io->write('');
     }
 

+ 11 - 10
src/Composer/Downloader/PearPackageExtractor.php

@@ -138,8 +138,9 @@ class PearPackageExtractor
     {
         /** @var $package \SimpleXmlElement */
         $package = simplexml_load_file($this->combine($source, 'package.xml'));
-        if(false === $package)
+        if (false === $package) {
             throw new \RuntimeException('Package definition file is not valid.');
+        }
 
         $packageSchemaVersion = $package['version'];
         if ('1.0' == $packageSchemaVersion) {
@@ -203,16 +204,16 @@ class PearPackageExtractor
             /** @var $child \SimpleXMLElement */
             if ($child->getName() == 'dir') {
                 $dirSource = $this->combine($source, (string) $child['name']);
-                $dirTarget = $child['baseinstalldir'] ? : $target;
-                $dirRole = $child['role'] ? : $role;
+                $dirTarget = $child['baseinstalldir'] ?: $target;
+                $dirRole = $child['role'] ?: $role;
                 $dirFiles = $this->buildSourceList10($child->children(), $targetRoles, $dirSource, $dirTarget, $dirRole, $packageName);
                 $result = array_merge($result, $dirFiles);
             } elseif ($child->getName() == 'file') {
-                $fileRole = (string) $child['role'] ? : $role;
+                $fileRole = (string) $child['role'] ?: $role;
                 if (isset($targetRoles[$fileRole])) {
-                    $fileName = (string) ($child['name'] ? : $child[0]); // $child[0] means text content
+                    $fileName = (string) ($child['name'] ?: $child[0]); // $child[0] means text content
                     $fileSource = $this->combine($source, $fileName);
-                    $fileTarget = $this->combine((string) $child['baseinstalldir'] ? : $target, $fileName);
+                    $fileTarget = $this->combine((string) $child['baseinstalldir'] ?: $target, $fileName);
                     if (!in_array($fileRole, self::$rolesWithoutPackageNamePrefix)) {
                         $fileTarget = $packageName . '/' . $fileTarget;
                     }
@@ -233,15 +234,15 @@ class PearPackageExtractor
             /** @var $child \SimpleXMLElement */
             if ('dir' == $child->getName()) {
                 $dirSource = $this->combine($source, $child['name']);
-                $dirTarget = $child['baseinstalldir'] ? : $target;
-                $dirRole = $child['role'] ? : $role;
+                $dirTarget = $child['baseinstalldir'] ?: $target;
+                $dirRole = $child['role'] ?: $role;
                 $dirFiles = $this->buildSourceList20($child->children(), $targetRoles, $dirSource, $dirTarget, $dirRole, $packageName);
                 $result = array_merge($result, $dirFiles);
             } elseif ('file' == $child->getName()) {
-                $fileRole = (string) $child['role'] ? : $role;
+                $fileRole = (string) $child['role'] ?: $role;
                 if (isset($targetRoles[$fileRole])) {
                     $fileSource = $this->combine($source, (string) $child['name']);
-                    $fileTarget = $this->combine((string) ($child['baseinstalldir'] ? : $target), (string) $child['name']);
+                    $fileTarget = $this->combine((string) ($child['baseinstalldir'] ?: $target), (string) $child['name']);
                     $fileTasks = array();
                     foreach ($child->children('http://pear.php.net/dtd/tasks-1.0') as $taskNode) {
                         if ('replace' == $taskNode->getName()) {

+ 3 - 3
src/Composer/EventDispatcher/Event.php

@@ -42,9 +42,9 @@ class Event
     /**
      * Constructor.
      *
-     * @param string $name   The event name
-     * @param array  $args   Arguments passed by the user
-     * @param array  $flags  Optional flags to pass data not as argument
+     * @param string $name  The event name
+     * @param array  $args  Arguments passed by the user
+     * @param array  $flags Optional flags to pass data not as argument
      */
     public function __construct($name, array $args = array(), array $flags = array())
     {

+ 12 - 13
src/Composer/EventDispatcher/EventDispatcher.php

@@ -79,12 +79,12 @@ class EventDispatcher
     /**
      * Dispatch a script event.
      *
-     * @param  string       $eventName The constant in ScriptEvents
-     * @param  bool         $devMode
-     * @param  array        $additionalArgs Arguments passed by the user
-     * @param  array        $flags          Optional flags to pass data not as argument
-     * @return int          return code of the executed script if any, for php scripts a false return
-     *                                value is changed to 1, anything else to 0
+     * @param  string $eventName      The constant in ScriptEvents
+     * @param  bool   $devMode
+     * @param  array  $additionalArgs Arguments passed by the user
+     * @param  array  $flags          Optional flags to pass data not as argument
+     * @return int    return code of the executed script if any, for php scripts a false return
+     *                               value is changed to 1, anything else to 0
      */
     public function dispatchScript($eventName, $devMode = false, $additionalArgs = array(), $flags = array())
     {
@@ -108,19 +108,18 @@ class EventDispatcher
     /**
      * Dispatch a command event.
      *
-     * @param  string  $eventName The constant in ScriptEvents
-     * @param  boolean $devMode   Whether or not we are in dev mode
+     * @param  string  $eventName      The constant in ScriptEvents
+     * @param  boolean $devMode        Whether or not we are in dev mode
      * @param  array   $additionalArgs Arguments passed by the user
      * @param  array   $flags          Optional flags to pass data not as argument
      * @return int     return code of the executed script if any, for php scripts a false return
-     *                           value is changed to 1, anything else to 0
+     *                                value is changed to 1, anything else to 0
      */
     public function dispatchCommandEvent($eventName, $devMode, $additionalArgs = array(), $flags = array())
     {
         return $this->doDispatch(new CommandEvent($eventName, $this->composer, $this->io, $devMode, $additionalArgs, $flags));
     }
 
-
     /**
      * Dispatch a installer event.
      *
@@ -132,7 +131,7 @@ class EventDispatcher
      * @param array               $operations    The list of operations
      *
      * @return int return code of the executed script if any, for php scripts a false return
-     *                            value is changed to 1, anything else to 0
+     *             value is changed to 1, anything else to 0
      */
     public function dispatchInstallerEvent($eventName, PolicyInterface $policy, Pool $pool, CompositeRepository $installedRepo, Request $request, array $operations = array())
     {
@@ -142,10 +141,10 @@ class EventDispatcher
     /**
      * Triggers the listeners of an event.
      *
-     * @param  Event             $event The event object to pass to the event handlers/listeners.
+     * @param  Event             $event          The event object to pass to the event handlers/listeners.
      * @param  string            $additionalArgs
      * @return int               return code of the executed script if any, for php scripts a false return
-     *                                 value is changed to 1, anything else to 0
+     *                                          value is changed to 1, anything else to 0
      * @throws \RuntimeException
      * @throws \Exception
      */

+ 6 - 6
src/Composer/Factory.php

@@ -85,7 +85,7 @@ class Factory
     }
 
     /**
-     * @param IOInterface|null $io
+     * @param  IOInterface|null $io
      * @return Config
      */
     public static function createConfig(IOInterface $io = null)
@@ -335,8 +335,8 @@ class Factory
     }
 
      /**
-     * @param Config $config
-     * @param string $vendorDir
+     * @param  Config                                        $config
+     * @param  string                                        $vendorDir
      * @return Repository\InstalledFilesystemRepository|null
      */
     protected function createGlobalRepository(Config $config, $vendorDir)
@@ -415,9 +415,9 @@ class Factory
     }
 
     /**
-     * @param Composer            $composer
-     * @param IOInterface         $io
-     * @param RepositoryInterface $globalRepository
+     * @param  Composer             $composer
+     * @param  IOInterface          $io
+     * @param  RepositoryInterface  $globalRepository
      * @return Plugin\PluginManager
      */
     protected function createPluginManager(Composer $composer, IOInterface $io, RepositoryInterface $globalRepository = null)

+ 3 - 3
src/Composer/Installer.php

@@ -380,7 +380,7 @@ class Installer
         }
 
         if ($this->update) {
-            $this->io->write('<info>Updating dependencies'.($withDevReqs?' (including require-dev)':'').'</info>');
+            $this->io->write('<info>Updating dependencies'.($withDevReqs ? ' (including require-dev)' : '').'</info>');
 
             $request->updateAll();
 
@@ -431,7 +431,7 @@ class Installer
                 }
             }
         } elseif ($installFromLock) {
-            $this->io->write('<info>Installing dependencies'.($withDevReqs?' (including require-dev)':'').' from lock file</info>');
+            $this->io->write('<info>Installing dependencies'.($withDevReqs ? ' (including require-dev)' : '').' from lock file</info>');
 
             if (!$this->locker->isFresh()) {
                 $this->io->write('<warning>Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. Run update to update them.</warning>');
@@ -451,7 +451,7 @@ class Installer
                 $request->install($link->getTarget(), $link->getConstraint());
             }
         } else {
-            $this->io->write('<info>Installing dependencies'.($withDevReqs?' (including require-dev)':'').'</info>');
+            $this->io->write('<info>Installing dependencies'.($withDevReqs ? ' (including require-dev)' : '').'</info>');
 
             if ($withDevReqs) {
                 $links = array_merge($this->package->getRequires(), $this->package->getDevRequires());

+ 0 - 1
src/Composer/Installer/PluginInstaller.php

@@ -40,7 +40,6 @@ class PluginInstaller extends LibraryInstaller
     {
         parent::__construct($io, $composer, 'composer-plugin');
         $this->installationManager = $composer->getInstallationManager();
-
     }
 
     /**

+ 2 - 2
src/Composer/Json/JsonFile.php

@@ -188,8 +188,8 @@ class JsonFile
 
             //  compact brackets to follow recent php versions
             if (PHP_VERSION_ID < 50428 || (PHP_VERSION_ID >= 50500 && PHP_VERSION_ID < 50512)) {
-               $json = preg_replace('/\[\s+\]/', '[]', $json);
-               $json = preg_replace('/\{\s+\}/', '{}', $json);
+                $json = preg_replace('/\[\s+\]/', '[]', $json);
+                $json = preg_replace('/\{\s+\}/', '{}', $json);
             }
 
             return $json;

+ 1 - 1
src/Composer/Json/JsonManipulator.php

@@ -42,7 +42,7 @@ class JsonManipulator
         if (!$this->pregMatch('#^\{(.*)\}$#s', $contents)) {
             throw new \InvalidArgumentException('The json file must be an object ({})');
         }
-        $this->newline = false !== strpos($contents, "\r\n") ? "\r\n": "\n";
+        $this->newline = false !== strpos($contents, "\r\n") ? "\r\n" : "\n";
         $this->contents = $contents === '{}' ? '{' . $this->newline . '}' : $contents;
         $this->detectIndenting();
     }

+ 0 - 1
src/Composer/Package/LinkConstraint/SpecificConstraint.php

@@ -50,5 +50,4 @@ abstract class SpecificConstraint implements LinkConstraintInterface
     // implementations must implement a method of this format:
     // not declared abstract here because type hinting violates parameter coherence (TODO right word?)
     // public function matchSpecific(<SpecificConstraintType> $provider);
-
 }

+ 1 - 1
src/Composer/Package/Loader/ArrayLoader.php

@@ -67,7 +67,7 @@ class ArrayLoader implements LoaderInterface
                 throw new \UnexpectedValueException('Package '.$config['name'].'\'s bin key should be an array, '.gettype($config['bin']).' given.');
             }
             foreach ($config['bin'] as $key => $bin) {
-                $config['bin'][$key]= ltrim($bin, '/');
+                $config['bin'][$key] = ltrim($bin, '/');
             }
             $package->setBinaries($config['bin']);
         }

+ 1 - 1
src/Composer/Package/Locker.php

@@ -297,7 +297,7 @@ class Locker
                 $time = $this->getPackageTime($package) ?: $time;
             }
             if (null !== $time) {
-               $spec['time'] = $time;
+                $spec['time'] = $time;
             }
 
             unset($spec['installation-source']);

+ 4 - 2
src/Composer/Package/Version/VersionParser.php

@@ -150,7 +150,8 @@ class VersionParser
         if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) {
             try {
                 return $this->normalizeBranch($match[1]);
-            } catch (\Exception $e) {}
+            } catch (\Exception $e) {
+            }
         }
 
         $extraMessage = '';
@@ -365,7 +366,8 @@ class VersionParser
                 }
 
                 return array(new VersionConstraint($matches[1] ?: '=', $version));
-            } catch (\Exception $e) { }
+            } catch (\Exception $e) {
+            }
         }
 
         $message = 'Could not parse version constraint '.$constraint;

+ 4 - 3
src/Composer/Package/Version/VersionSelector.php

@@ -37,8 +37,8 @@ class VersionSelector
      * Given a package name and optional version, returns the latest PackageInterface
      * that matches.
      *
-     * @param string    $packageName
-     * @param string    $targetPackageVersion
+     * @param  string                $packageName
+     * @param  string                $targetPackageVersion
      * @return PackageInterface|bool
      */
     public function findBestCandidate($packageName, $targetPackageVersion = null)
@@ -73,7 +73,7 @@ class VersionSelector
      *  * dev-master    -> ~2.1@dev      (dev version with alias)
      *  * dev-master    -> dev-master    (dev versions are untouched)
      *
-     * @param PackageInterface $package
+     * @param  PackageInterface $package
      * @return string
      */
     public function findRecommendedRequireVersion(PackageInterface $package)
@@ -90,6 +90,7 @@ class VersionSelector
             $extra = preg_replace('{^(\d+\.\d+\.\d+)(\.9999999)-dev$}', '$1.0', $extra, -1, $count);
             if ($count) {
                 $extra = str_replace('.9999999', '.0', $extra);
+
                 return $this->transformVersion($extra, $extra, 'dev');
             }
         }

+ 1 - 1
src/Composer/Repository/ArtifactRepository.php

@@ -96,7 +96,7 @@ class ArtifactRepository extends ArrayRepository
                     return $i;
                 }
 
-                if(strpos($directoryName, '\\') !== false ||
+                if (strpos($directoryName, '\\') !== false ||
                    strpos($directoryName, '/') !== false) {
                     //composer.json files below first directory are rejected
                     continue;

+ 2 - 2
src/Composer/Repository/Pear/PackageDependencyParser.php

@@ -51,7 +51,7 @@ class PackageDependencyParser
      */
     private function buildDependency10Info($depArray)
     {
-        static $dep10toOperatorMap = array('has'=>'==', 'eq' => '==', 'ge' => '>=', 'gt' => '>', 'le' => '<=', 'lt' => '<', 'not' => '!=');
+        static $dep10toOperatorMap = array('has' => '==', 'eq' => '==', 'ge' => '>=', 'gt' => '>', 'le' => '<=', 'lt' => '<', 'not' => '!=');
 
         $result = array();
 
@@ -255,7 +255,7 @@ class PackageDependencyParser
      */
     private function parse20VersionConstraint(array $data)
     {
-        static $dep20toOperatorMap = array('has'=>'==', 'min' => '>=', 'max' => '<=', 'exclude' => '!=');
+        static $dep20toOperatorMap = array('has' => '==', 'min' => '>=', 'max' => '<=', 'exclude' => '!=');
 
         $versions = array();
         $values = array_intersect_key($data, $dep20toOperatorMap);

+ 1 - 1
src/Composer/Repository/Vcs/GitDriver.php

@@ -203,7 +203,7 @@ class GitDriver extends VcsDriver
             foreach ($this->process->splitLines($output) as $branch) {
                 if ($branch && !preg_match('{^ *[^/]+/HEAD }', $branch)) {
                     if (preg_match('{^(?:\* )? *(\S+) *([a-f0-9]+) .*$}', $branch, $match)) {
-                       $branches[$match[1]] = $match[2];
+                        $branches[$match[1]] = $match[2];
                     }
                 }
             }

+ 0 - 1
src/Composer/Repository/Vcs/PerforceDriver.php

@@ -182,5 +182,4 @@ class PerforceDriver extends VcsDriver
     {
         return $this->branch;
     }
-
 }

+ 0 - 1
src/Composer/Repository/Vcs/SvnDriver.php

@@ -27,7 +27,6 @@ use Composer\Downloader\TransportException;
  */
 class SvnDriver extends VcsDriver
 {
-
     /**
      * @var Cache
      */

+ 1 - 1
src/Composer/Util/NoProxyPattern.php

@@ -126,7 +126,7 @@ class NoProxyPattern
 
         // Now do some bit shifting/switching to convert to ints
         $i    = ($a << 24) + ($b << 16) + ($c << 8) + $d;
-        $mask = $bits == 0 ? 0: (~0 << (32 - $bits));
+        $mask = $bits == 0 ? 0 : (~0 << (32 - $bits));
 
         // Here's our lowest int
         $low = $i & $mask;

+ 0 - 1
src/Composer/Util/Perforce.php

@@ -570,5 +570,4 @@ class Perforce
     {
         $this->filesystem = $fs;
     }
-
 }

+ 4 - 4
src/Composer/Util/ProcessExecutor.php

@@ -105,7 +105,7 @@ class ProcessExecutor
     {
         static::$timeout = $timeout;
     }
-    
+
     /**
      * Escapes a string to be used as a shell argument.
      *
@@ -113,9 +113,9 @@ class ProcessExecutor
      *
      * @return string The escaped argument
      */
-    
-    public static function escape ($argument)
+
+    public static function escape($argument)
     {
-    	return ProcessUtils::escapeArgument($argument);
+        return ProcessUtils::escapeArgument($argument);
     }
 }

+ 0 - 1
src/Composer/Util/Svn.php

@@ -137,7 +137,6 @@ class Svn
 
         // try to authenticate if maximum quantity of tries not reached
         if ($this->qtyAuthTries++ < self::MAX_QTY_AUTH_TRIES) {
-
             // restart the process
             return $this->execute($command, $url, $cwd, $path, $verbose);
         }

+ 1 - 1
tests/Composer/Test/Autoload/ClassLoaderTest.php

@@ -18,7 +18,7 @@ class ClassLoaderTest extends \PHPUnit_Framework_TestCase
      * @param bool   $prependSeparator Whether to call ->loadClass() with a class name with preceding
      *                                 namespace separator, as it happens in PHP 5.3.0 - 5.3.2. See https://bugs.php.net/50731
      */
-    public function testLoadClass($class, $prependSeparator = FALSE)
+    public function testLoadClass($class, $prependSeparator = false)
     {
         $loader = new ClassLoader();
         $loader->add('Namespaced\\', __DIR__ . '/Fixtures');

+ 0 - 1
tests/Composer/Test/Config/JsonConfigSourceTest.php

@@ -48,7 +48,6 @@ class JsonConfigSourceTest extends \PHPUnit_Framework_TestCase
             $value,
             $this->fixturePath('addLink/'.$fixtureBasename.'.json'),
         );
-
     }
 
     /**

+ 1 - 2
tests/Composer/Test/DependencyResolver/SolverTest.php

@@ -654,8 +654,7 @@ class SolverTest extends TestCase
     public function testConflictResultEmpty()
     {
         $this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
-        $this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));;
-
+        $this->repo->addPackage($packageB = $this->getPackage('B', '1.0'));
         $packageA->setConflicts(array(
             'b' => new Link('A', 'B', $this->getVersionConstraint('>=', '1.0'), 'conflicts'),
         ));

+ 7 - 7
tests/Composer/Test/Downloader/PearPackageExtractorTest.php

@@ -25,19 +25,19 @@ class PearPackageExtractorTest extends \PHPUnit_Framework_TestCase
         $fileActions = $method->invoke($extractor, __DIR__ . '/Fixtures/Package_v1.0', array('php' => '/'), array());
 
         $expectedFileActions = array(
-            'Gtk.php' => Array(
+            'Gtk.php' => array(
                 'from' => 'PEAR_Frontend_Gtk-0.4.0/Gtk.php',
                 'to' => 'PEAR/Frontend/Gtk.php',
                 'role' => 'php',
                 'tasks' => array(),
             ),
-            'Gtk/Config.php' => Array(
+            'Gtk/Config.php' => array(
                 'from' => 'PEAR_Frontend_Gtk-0.4.0/Gtk/Config.php',
                 'to' => 'PEAR/Frontend/Gtk/Config.php',
                 'role' => 'php',
                 'tasks' => array(),
             ),
-            'Gtk/xpm/black_close_icon.xpm' => Array(
+            'Gtk/xpm/black_close_icon.xpm' => array(
                 'from' => 'PEAR_Frontend_Gtk-0.4.0/Gtk/xpm/black_close_icon.xpm',
                 'to' => 'PEAR/Frontend/Gtk/xpm/black_close_icon.xpm',
                 'role' => 'php',
@@ -56,7 +56,7 @@ class PearPackageExtractorTest extends \PHPUnit_Framework_TestCase
         $fileActions = $method->invoke($extractor, __DIR__ . '/Fixtures/Package_v2.0', array('php' => '/'), array());
 
         $expectedFileActions = array(
-            'URL.php' => Array(
+            'URL.php' => array(
                 'from' => 'Net_URL-1.0.15/URL.php',
                 'to' => 'Net/URL.php',
                 'role' => 'php',
@@ -75,13 +75,13 @@ class PearPackageExtractorTest extends \PHPUnit_Framework_TestCase
         $fileActions = $method->invoke($extractor, __DIR__ . '/Fixtures/Package_v2.1', array('php' => '/', 'script' => '/bin'), array());
 
         $expectedFileActions = array(
-            'php/Zend/Authentication/Storage/StorageInterface.php' => Array(
+            'php/Zend/Authentication/Storage/StorageInterface.php' => array(
                 'from' => 'Zend_Authentication-2.0.0beta4/php/Zend/Authentication/Storage/StorageInterface.php',
                 'to' => '/php/Zend/Authentication/Storage/StorageInterface.php',
                 'role' => 'php',
                 'tasks' => array(),
             ),
-            'php/Zend/Authentication/Result.php' => Array(
+            'php/Zend/Authentication/Result.php' => array(
                 'from' => 'Zend_Authentication-2.0.0beta4/php/Zend/Authentication/Result.php',
                 'to' => '/php/Zend/Authentication/Result.php',
                 'role' => 'php',
@@ -98,7 +98,7 @@ class PearPackageExtractorTest extends \PHPUnit_Framework_TestCase
                     )
                 )
             ),
-            'renamedFile.php' => Array(
+            'renamedFile.php' => array(
                 'from' => 'Zend_Authentication-2.0.0beta4/renamedFile.php',
                 'to' => 'correctFile.php',
                 'role' => 'php',

+ 0 - 1
tests/Composer/Test/Downloader/PerforceDownloaderTest.php

@@ -22,7 +22,6 @@ use Composer\IO\IOInterface;
  */
 class PerforceDownloaderTest extends \PHPUnit_Framework_TestCase
 {
-
     protected $config;
     protected $downloader;
     protected $io;

+ 1 - 1
tests/Composer/Test/InstallerTest.php

@@ -152,7 +152,7 @@ class InstallerTest extends TestCase
         $io->expects($this->any())
             ->method('write')
             ->will($this->returnCallback(function ($text, $newline) use (&$output) {
-                $output .= $text . ($newline ? "\n":"");
+                $output .= $text . ($newline ? "\n" : "");
             }));
 
         $composer = FactoryMock::create($io, $composerConfig);

+ 0 - 1
tests/Composer/Test/Json/JsonFileTest.php

@@ -226,5 +226,4 @@ class JsonFileTest extends \PHPUnit_Framework_TestCase
             $this->assertEquals($json, $file->encode($data, $options));
         }
     }
-
 }

+ 0 - 1
tests/Composer/Test/Json/JsonFormatterTest.php

@@ -46,5 +46,4 @@ class JsonFormatterTest extends \PHPUnit_Framework_TestCase
 
         return implode('+', $codes);
     }
-
 }

+ 0 - 1
tests/Composer/Test/Mock/RemoteFilesystemMock.php

@@ -36,5 +36,4 @@ class RemoteFilesystemMock extends RemoteFilesystem
 
         throw new TransportException('The "'.$fileUrl.'" file could not be downloaded (NOT FOUND)', 404);
     }
-
 }

+ 0 - 1
tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php

@@ -13,7 +13,6 @@
 namespace Composer\Test\Package\Archiver;
 
 use Composer\Factory;
-use Composer\Package\Archiver;
 use Composer\Package\PackageInterface;
 
 class ArchiveManagerTest extends ArchiverTest

+ 1 - 1
tests/Composer/Test/Plugin/PluginInstallerTest.php

@@ -39,7 +39,7 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase
         $this->directory = sys_get_temp_dir() . '/' . uniqid();
         for ($i = 1; $i <= 4; $i++) {
             $filename = '/Fixtures/plugin-v'.$i.'/composer.json';
-            mkdir(dirname($this->directory . $filename), 0777, TRUE);
+            mkdir(dirname($this->directory . $filename), 0777, true);
             $this->packages[] = $loader->load(__DIR__ . $filename);
         }
 

+ 0 - 2
tests/Composer/Test/Repository/ArtifactRepositoryTest.php

@@ -16,7 +16,6 @@ use Composer\TestCase;
 use Composer\IO\NullIO;
 use Composer\Config;
 use Composer\Package\BasePackage;
-use Composer\Util\Filesystem;
 
 class ArtifactRepositoryTest extends TestCase
 {
@@ -67,7 +66,6 @@ class ArtifactRepositoryTest extends TestCase
             $this->assertTrue(strpos($package->getDistUrl(), $relativePath) === 0);
         }
     }
-
 }
 
 //Files jsonInFirstLevel.zip, jsonInRoot.zip and jsonInSecondLevel.zip were generated with:

+ 1 - 2
tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php

@@ -73,7 +73,7 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase
     protected function getTestConfig($testPath)
     {
         $config = new Config();
-        $config->merge(array('config'=>array('home'=>$testPath)));
+        $config->merge(array('config' => array('home' => $testPath)));
 
         return $config;
     }
@@ -173,5 +173,4 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase
         $this->perforce->expects($this->once())->method('cleanupClientSpec');
         $this->driver->cleanup();
     }
-
 }

+ 0 - 1
tests/Composer/Test/Util/PerforceTest.php

@@ -718,5 +718,4 @@ class PerforceTest extends \PHPUnit_Framework_TestCase
 
         $this->perforce->cleanupClientSpec();
     }
-
 }