Jordi Boggiano 9 years ago
parent
commit
6a64041055

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

@@ -290,8 +290,8 @@ EOT
 
         // handler Ctrl+C for unix-like systems
         if (function_exists('pcntl_signal')) {
-            declare(ticks = 100);
-            pcntl_signal(SIGINT, function() use ($directory) {
+            declare (ticks = 100);
+            pcntl_signal(SIGINT, function () use ($directory) {
                 $fs = new Filesystem();
                 $fs->removeDirectory($directory);
                 exit(130);

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

@@ -295,7 +295,7 @@ EOT
 
     private function checkDiskSpace($config)
     {
-        $minSpaceFree = 1024*1024;
+        $minSpaceFree = 1024 * 1024;
         if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
             || (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
         ) {

+ 1 - 1
src/Composer/Console/Application.php

@@ -181,7 +181,7 @@ class Application extends BaseApplication
             if ($composer) {
                 $config = $composer->getConfig();
 
-                $minSpaceFree = 1024*1024;
+                $minSpaceFree = 1024 * 1024;
                 if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
                     || (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
                     || (($df = @disk_free_space($dir = sys_get_temp_dir())) !== false && $df < $minSpaceFree)

+ 1 - 0
src/Composer/Console/HtmlOutputFormatter.php

@@ -60,6 +60,7 @@ class HtmlOutputFormatter extends OutputFormatter
         $formatted = parent::format($message);
 
         $clearEscapeCodes = '(?:39|49|0|22|24|25|27|28)';
+
         return preg_replace_callback("{\033\[([0-9;]+)m(.*?)\033\[(?:".$clearEscapeCodes.";)*?".$clearEscapeCodes."m}s", array($this, 'formatHtml'), $formatted);
     }
 

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

@@ -32,7 +32,7 @@ class SolverProblemsException extends \RuntimeException
     {
         $text = "\n";
         foreach ($this->problems as $i => $problem) {
-            $text .= "  Problem ".($i+1).$problem->getPrettyString($this->installedMap)."\n";
+            $text .= "  Problem ".($i + 1).$problem->getPrettyString($this->installedMap)."\n";
         }
 
         if (strpos($text, 'could not be found') || strpos($text, 'no matching package found')) {

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

@@ -115,7 +115,7 @@ abstract class ArchiveDownloader extends FileDownloader
                 // update api archives to the proper reference
                 $url = 'https://api.github.com/repos/' . $match[1] . '/'. $match[2] . '/' . $match[3] . 'ball/' . $package->getDistReference();
             }
-        } else if ($package->getDistReference() && strpos($url, 'bitbucket.org')) {
+        } elseif ($package->getDistReference() && strpos($url, 'bitbucket.org')) {
             if (preg_match('{^https?://(?:www\.)?bitbucket\.org/([^/]+)/([^/]+)/get/(.+)\.(zip|tar\.gz|tar\.bz2)$}i', $url, $match)) {
                 // update Bitbucket archives to the proper reference
                 $url = 'https://bitbucket.org/' . $match[1] . '/'. $match[2] . '/get/' . $package->getDistReference() . '.' . $match[4];

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

@@ -141,10 +141,10 @@ class VersionParser
                 if ('stable' === $matches[$index]) {
                     return $version;
                 }
-                $version .= '-' . $this->expandStability($matches[$index]) . (!empty($matches[$index+1]) ? $matches[$index+1] : '');
+                $version .= '-' . $this->expandStability($matches[$index]) . (!empty($matches[$index + 1]) ? $matches[$index + 1] : '');
             }
 
-            if (!empty($matches[$index+2])) {
+            if (!empty($matches[$index + 2])) {
                 $version .= '-dev';
             }
 
@@ -530,8 +530,8 @@ class VersionParser
 
         for ($i = 0, $count = count($pairs); $i < $count; $i++) {
             $pair = preg_replace('{^([^=: ]+)[=: ](.*)$}', '$1 $2', trim($pairs[$i]));
-            if (false === strpos($pair, ' ') && isset($pairs[$i+1]) && false === strpos($pairs[$i+1], '/')) {
-                $pair .= ' '.$pairs[$i+1];
+            if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/')) {
+                $pair .= ' '.$pairs[$i + 1];
                 $i++;
             }
 

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

@@ -58,6 +58,7 @@ class ErrorHandler
                     if (isset($a['line'], $a['file'])) {
                         return '<warning> '.$a['file'].':'.$a['line'].'</warning>';
                     }
+
                     return null;
                 }, array_slice(debug_backtrace(), 2))));
             }

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

@@ -94,6 +94,7 @@ class GitHub
         if (!$token) {
             $this->io->writeError('<warning>No token given, aborting.</warning>');
             $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com <token>"');
+
             return false;
         }
 

+ 0 - 1
tests/Composer/Test/EventDispatcher/EventDispatcherTest.php

@@ -13,7 +13,6 @@
 namespace Composer\Test\EventDispatcher;
 
 use Composer\EventDispatcher\Event;
-use Composer\EventDispatcher\EventDispatcher;
 use Composer\Installer\InstallerEvents;
 use Composer\TestCase;
 use Composer\Script\ScriptEvents;

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

@@ -14,7 +14,6 @@ namespace Composer\Test;
 
 use Composer\Installer;
 use Composer\Console\Application;
-use Composer\Config;
 use Composer\Json\JsonFile;
 use Composer\Repository\ArrayRepository;
 use Composer\Repository\RepositoryManager;

+ 0 - 2
tests/Composer/Test/Package/BasePackageTest.php

@@ -12,8 +12,6 @@
 
 namespace Composer\Test\Package;
 
-use Composer\Package\BasePackage;
-
 class BasePackageTest extends \PHPUnit_Framework_TestCase
 {
     public function testSetSameRepository()

+ 0 - 1
tests/Composer/Test/Package/Loader/RootPackageLoaderTest.php

@@ -16,7 +16,6 @@ use Composer\Config;
 use Composer\Package\Loader\RootPackageLoader;
 use Composer\Package\BasePackage;
 use Composer\Test\Mock\ProcessExecutorMock;
-use Composer\Repository\RepositoryManager;
 
 class RootPackageLoaderTest extends \PHPUnit_Framework_TestCase
 {

+ 0 - 1
tests/Composer/Test/Package/Loader/ValidatingArrayLoaderTest.php

@@ -12,7 +12,6 @@
 
 namespace Composer\Test\Package\Loader;
 
-use Composer\Package;
 use Composer\Package\Loader\ValidatingArrayLoader;
 use Composer\Package\Loader\InvalidPackageException;
 

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

@@ -242,7 +242,7 @@ class PluginInstallerTest extends TestCase
         $this->repository
              ->expects($this->any())
              ->method('getPackages')
-             ->will($this->returnCallback(function() use($plugApiInternalPackage, $plugins) {
+             ->will($this->returnCallback(function () use ($plugApiInternalPackage, $plugins) {
                 return array_merge(array($plugApiInternalPackage), $plugins);
              }));
 

+ 0 - 1
tests/Composer/Test/Repository/ComposerRepositoryTest.php

@@ -12,7 +12,6 @@
 
 namespace Composer\Test\Repository;
 
-use Composer\Repository\ComposerRepository;
 use Composer\IO\NullIO;
 use Composer\Test\Mock\FactoryMock;
 use Composer\TestCase;

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

@@ -13,7 +13,6 @@
 namespace Composer\Test\Util;
 
 use Composer\Util\RemoteFilesystem;
-use Installer\Exception;
 
 class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase
 {

+ 0 - 1
tests/Composer/TestCase.php

@@ -13,7 +13,6 @@
 namespace Composer;
 
 use Composer\Package\Version\VersionParser;
-use Composer\Package\Package;
 use Composer\Package\AliasPackage;
 use Composer\Package\LinkConstraint\VersionConstraint;
 use Composer\Util\Filesystem;