diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index e5cceb43a..cb70700dd 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -317,6 +317,7 @@ EOF; return array( $filesCode); + EOF; } diff --git a/src/Composer/Command/GlobalCommand.php b/src/Composer/Command/GlobalCommand.php index 5fe7e4f47..15f1fff08 100644 --- a/src/Composer/Command/GlobalCommand.php +++ b/src/Composer/Command/GlobalCommand.php @@ -42,7 +42,7 @@ is to add the COMPOSER_HOME/vendor/bin dir to your PATH env var. COMPOSER_HOME is c:\Users\\AppData\Roaming\Composer on Windows and /home//.composer on unix systems. -Note: This path may vary depending on customizations to bin-dir in +Note: This path may vary depending on customizations to bin-dir in composer.json or the environmental variable COMPOSER_BIN_DIR. EOT diff --git a/src/Composer/DependencyResolver/Pool.php b/src/Composer/DependencyResolver/Pool.php index 309c6e471..96198f4d6 100644 --- a/src/Composer/DependencyResolver/Pool.php +++ b/src/Composer/DependencyResolver/Pool.php @@ -377,6 +377,7 @@ class Pool if ($constraint === null) { return self::MATCH; } + return $constraint->matches(new VersionConstraint('==', $candidateVersion)) ? self::MATCH : self::MATCH_NAME; } diff --git a/src/Composer/Downloader/ChangeReportInterface.php b/src/Composer/Downloader/ChangeReportInterface.php index e60615431..3fb1dc5d0 100644 --- a/src/Composer/Downloader/ChangeReportInterface.php +++ b/src/Composer/Downloader/ChangeReportInterface.php @@ -24,9 +24,9 @@ interface ChangeReportInterface /** * Checks for changes to the local copy * - * @param PackageInterface $package package instance - * @param string $path package directory - * @return string|null changes or null + * @param PackageInterface $package package instance + * @param string $path package directory + * @return string|null changes or null */ public function getLocalChanges(PackageInterface $package, $path); } diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index e52fea0c1..6581b6ca7 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -45,12 +45,12 @@ class FileDownloader implements DownloaderInterface /** * Constructor. * - * @param IOInterface $io The IO instance - * @param Config $config The config + * @param IOInterface $io The IO instance + * @param Config $config The config * @param EventDispatcher $eventDispatcher The event dispatcher - * @param Cache $cache Optional cache instance - * @param RemoteFilesystem $rfs The remote filesystem - * @param Filesystem $filesystem The filesystem + * @param Cache $cache Optional cache instance + * @param RemoteFilesystem $rfs The remote filesystem + * @param Filesystem $filesystem The filesystem */ public function __construct(IOInterface $io, Config $config, EventDispatcher $eventDispatcher = null, Cache $cache = null, RemoteFilesystem $rfs = null, Filesystem $filesystem = null) { diff --git a/src/Composer/Downloader/PerforceDownloader.php b/src/Composer/Downloader/PerforceDownloader.php index 6ddea153f..be6e2ddb1 100644 --- a/src/Composer/Downloader/PerforceDownloader.php +++ b/src/Composer/Downloader/PerforceDownloader.php @@ -10,7 +10,6 @@ * file that was distributed with this source code. */ - namespace Composer\Downloader; use Composer\Package\PackageInterface; @@ -75,16 +74,17 @@ class PerforceDownloader extends VcsDownloader public function getLocalChanges(PackageInterface $package, $path) { $this->io->write('Perforce driver does not check for local changes before overriding', true); + return; } - /** * {@inheritDoc} */ protected function getCommitLogs($fromReference, $toReference, $path) { $commitLogs = $this->perforce->getCommitLogs($fromReference, $toReference); + return $commitLogs; } diff --git a/src/Composer/Downloader/VcsDownloader.php b/src/Composer/Downloader/VcsDownloader.php index d3253d956..4e06d63f8 100644 --- a/src/Composer/Downloader/VcsDownloader.php +++ b/src/Composer/Downloader/VcsDownloader.php @@ -148,8 +148,8 @@ abstract class VcsDownloader implements DownloaderInterface, ChangeReportInterfa * Prompt the user to check if changes should be stashed/removed or the operation aborted * * @param PackageInterface $package - * @param string $path - * @param bool $update if true (update) the changes can be stashed and reapplied after an update, + * @param string $path + * @param bool $update if true (update) the changes can be stashed and reapplied after an update, * if false (remove) the changes should be assumed to be lost if the operation is not aborted * @throws \RuntimeException in case the operation must be aborted */ diff --git a/src/Composer/EventDispatcher/Event.php b/src/Composer/EventDispatcher/Event.php index 8a9352653..0b3c9c951 100644 --- a/src/Composer/EventDispatcher/Event.php +++ b/src/Composer/EventDispatcher/Event.php @@ -32,7 +32,7 @@ class Event /** * Constructor. * - * @param string $name The event name + * @param string $name The event name */ public function __construct($name) { diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 912d4eaea..9c2aee91f 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -202,7 +202,7 @@ class EventDispatcher /** * Retrieves all listeners for a given event * - * @param Event $event + * @param Event $event * @return array All listeners: callables and scripts */ protected function getListeners(Event $event) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 1f794786b..c3367ba4a 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -177,7 +177,7 @@ class Factory * @param IOInterface $io IO instance * @param array|string|null $localConfig either a configuration array or a filename to read from, if null it will * read from the default filename - * @param bool $disablePlugins Whether plugins should not be loaded + * @param bool $disablePlugins Whether plugins should not be loaded * @throws \InvalidArgumentException * @throws \UnexpectedValueException * @return Composer @@ -432,7 +432,7 @@ class Factory * @param IOInterface $io IO instance * @param mixed $config either a configuration array or a filename to read from, if null it will read from * the default filename - * @param bool $disablePlugins Whether plugins should not be loaded + * @param bool $disablePlugins Whether plugins should not be loaded * @return Composer */ public static function create(IOInterface $io, $config = null, $disablePlugins = false) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 3e9a9bf6b..3184cc509 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -539,7 +539,6 @@ class Installer return true; } - /** * Workaround: if your packages depend on plugins, we must be sure * that those are installed / updated first; else it would lead to packages @@ -550,7 +549,7 @@ class Installer * it at least fixes the symptoms and makes usage of composer possible (again) * in such scenarios. * - * @param OperationInterface[] $operations + * @param OperationInterface[] $operations * @return OperationInterface[] reordered operation list */ private function movePluginsToFront(array $operations) @@ -559,7 +558,7 @@ class Installer foreach ($operations as $idx => $op) { if ($op instanceof InstallOperation) { $package = $op->getPackage(); - } else if ($op instanceof UpdateOperation) { + } elseif ($op instanceof UpdateOperation) { $package = $op->getTargetPackage(); } else { continue; diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index d48eb509f..aab3f4737 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/src/Composer/Installer/LibraryInstaller.php @@ -165,6 +165,7 @@ class LibraryInstaller implements InstallerInterface if (strpos($initialDownloadPath, $targetDownloadPath) === 0) { $this->removeCode($initial); $this->installCode($target); + return; } diff --git a/src/Composer/Package/Version/VersionParser.php b/src/Composer/Package/Version/VersionParser.php index f39e21d0f..8b519f943 100644 --- a/src/Composer/Package/Version/VersionParser.php +++ b/src/Composer/Package/Version/VersionParser.php @@ -368,9 +368,9 @@ class VersionParser * * Support function for {@link parseConstraint()} * - * @param array $matches Array with version parts in array indexes 1,2,3,4 + * @param array $matches Array with version parts in array indexes 1,2,3,4 * @param int $position 1,2,3,4 - which segment of the version to decrement - * @param string $pad The string to pad version parts after $position + * @param string $pad The string to pad version parts after $position * @return string The new version */ private function manipulateVersionString($matches, $position, $increment = 0, $pad = '0') @@ -378,7 +378,7 @@ class VersionParser for ($i = 4; $i > 0; $i--) { if ($i > $position) { $matches[$i] = $pad; - } else if ($i == $position && $increment) { + } elseif ($i == $position && $increment) { $matches[$i] += $increment; // If $matches[$i] was 0, carry the decrement if ($matches[$i] < 0) { diff --git a/src/Composer/Plugin/PluginInterface.php b/src/Composer/Plugin/PluginInterface.php index 3a33672a6..dea5828c1 100644 --- a/src/Composer/Plugin/PluginInterface.php +++ b/src/Composer/Plugin/PluginInterface.php @@ -32,7 +32,7 @@ interface PluginInterface /** * Apply plugin modifications to composer * - * @param Composer $composer + * @param Composer $composer * @param IOInterface $io */ public function activate(Composer $composer, IOInterface $io); diff --git a/src/Composer/Plugin/PreFileDownloadEvent.php b/src/Composer/Plugin/PreFileDownloadEvent.php index 38ea2620a..7ae6821ce 100644 --- a/src/Composer/Plugin/PreFileDownloadEvent.php +++ b/src/Composer/Plugin/PreFileDownloadEvent.php @@ -35,7 +35,7 @@ class PreFileDownloadEvent extends Event /** * Constructor. * - * @param string $name The event name + * @param string $name The event name * @param RemoteFilesystem $rfs * @param string $processedUrl */ diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index 7c4b72673..dcf791857 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -43,7 +43,6 @@ class PlatformRepository extends ArrayRepository $version = $versionParser->normalize($prettyVersion); } - $php = new CompletePackage('php', $version, $prettyVersion); $php->setDescription('The PHP interpreter'); parent::addPackage($php); diff --git a/src/Composer/Repository/Vcs/PerforceDriver.php b/src/Composer/Repository/Vcs/PerforceDriver.php index 03acd0a21..3c953793c 100644 --- a/src/Composer/Repository/Vcs/PerforceDriver.php +++ b/src/Composer/Repository/Vcs/PerforceDriver.php @@ -10,12 +10,10 @@ * file that was distributed with this source code. */ - namespace Composer\Repository\Vcs; use Composer\IO\IOInterface; use Composer\Util\ProcessExecutor; -use Composer\Util\Filesystem; use Composer\Util\Perforce; /** @@ -145,6 +143,7 @@ class PerforceDriver extends VcsDriver if (isset($this->composerInfo)) { $result = count($this->composerInfo) > 0; } + return $result; } diff --git a/src/Composer/Repository/Vcs/VcsDriver.php b/src/Composer/Repository/Vcs/VcsDriver.php index 6f49d5b82..6effb2235 100644 --- a/src/Composer/Repository/Vcs/VcsDriver.php +++ b/src/Composer/Repository/Vcs/VcsDriver.php @@ -103,7 +103,7 @@ abstract class VcsDriver implements VcsDriverInterface /** * Return if current repository url is local - * + * * @return boolean Repository url is local */ protected static function isLocalUrl($url) diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index 7ed74dfaf..58d807f40 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -44,7 +44,7 @@ class Filesystem /** * Checks if a directory is empty * - * @param string $dir + * @param string $dir * @return bool */ public function isDirEmpty($dir) diff --git a/src/Composer/Util/NoProxyPattern.php b/src/Composer/Util/NoProxyPattern.php index 930d12e22..b41c8ff52 100644 --- a/src/Composer/Util/NoProxyPattern.php +++ b/src/Composer/Util/NoProxyPattern.php @@ -105,7 +105,7 @@ class NoProxyPattern * http://framework.zend.com/svn/framework/extras/incubator/library/ZendX/Whois/Adapter/Cidr.php * * @param string $cidr IPv4 block in CIDR notation - * @param string $ip IPv4 address + * @param string $ip IPv4 address * * @return boolean */ diff --git a/src/Composer/Util/Perforce.php b/src/Composer/Util/Perforce.php index 2fb0e4bea..8a1ce4739 100644 --- a/src/Composer/Util/Perforce.php +++ b/src/Composer/Util/Perforce.php @@ -1,4 +1,5 @@ p4Stream = '//' . $this->p4Depot; } } + return $this->p4Stream; } @@ -268,6 +268,7 @@ class Perforce if ($index === false) { return false; } + return true; } @@ -329,7 +330,6 @@ class Perforce fclose($spec); } - protected function read($pipe, $name) { if (feof($pipe)) { @@ -347,10 +347,10 @@ class Perforce { $command = $this->generateP4Command(' login -a'); $process = new Process($command, null, null, $password); + return $process->run(); } - public function p4Login(IOInterface $io) { $this->queryP4User($io); @@ -369,6 +369,7 @@ class Perforce { $result = ''; $processExecutor->execute('p4 -p ' . $url . ' info -s', $result); + return false === strpos($result, 'error'); } @@ -380,6 +381,7 @@ class Perforce return $this->getComposerInformationFromPath($composerJson); } + return $this->getComposerInformationFromLabel($identifier, $index); } @@ -496,6 +498,7 @@ class Perforce } $fields = explode(' ', $changes); $changeList = $fields[1]; + return $changeList; } @@ -513,6 +516,7 @@ class Perforce $main = substr($fromReference, 0, $index) . '/...'; $command = $this->generateP4Command('filelog ' . $main . '@' . $fromChangeList. ',' . $toChangeList); $result = $this->executeCommand($command); + return $result; } } diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_files.php b/tests/Composer/Test/Autoload/Fixtures/autoload_files.php index 8ca59a91e..17225d047 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_files.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_files.php @@ -8,4 +8,4 @@ $baseDir = dirname($vendorDir); return array( $baseDir . '/foo.php', $baseDir . '/bar.php', -); \ No newline at end of file +); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_files_files_by_dependency.php b/tests/Composer/Test/Autoload/Fixtures/autoload_files_files_by_dependency.php index d1fde3835..6c8ce0466 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_files_files_by_dependency.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_files_files_by_dependency.php @@ -12,4 +12,4 @@ return array( $vendorDir . '/b/bar/testB.php', $vendorDir . '/e/e/testE.php', $baseDir . '/root.php', -); \ No newline at end of file +); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_files_functions.php b/tests/Composer/Test/Autoload/Fixtures/autoload_files_functions.php index 5eb29028d..0af7f8686 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_files_functions.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_files_functions.php @@ -11,4 +11,4 @@ return array( $vendorDir . '/c/c/foo/bar/test3.php', $baseDir . '/root.php', $vendorDir . '/c/c/foo/bar/test4.php', -); \ No newline at end of file +); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_files_target_dir.php b/tests/Composer/Test/Autoload/Fixtures/autoload_files_target_dir.php index 8ca59a91e..17225d047 100644 --- a/tests/Composer/Test/Autoload/Fixtures/autoload_files_target_dir.php +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_files_target_dir.php @@ -8,4 +8,4 @@ $baseDir = dirname($vendorDir); return array( $baseDir . '/foo.php', $baseDir . '/bar.php', -); \ No newline at end of file +); diff --git a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php index b247cfbf3..85093bf59 100644 --- a/tests/Composer/Test/Downloader/PerforceDownloaderTest.php +++ b/tests/Composer/Test/Downloader/PerforceDownloaderTest.php @@ -1,4 +1,5 @@ io = $this->getMock('Composer\IO\IOInterface'); } - public function testDoDownloadGetRepoConfig() { $downloader = new PerforceDownloader($this->io, $this->config); diff --git a/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php b/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php index 427b0d70c..a85555fc8 100644 --- a/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchiveManagerTest.php @@ -49,7 +49,7 @@ class ArchiveManagerTest extends ArchiverTest $target = $this->getTargetName($package, 'tar'); $this->assertFileExists($target); - + $tmppath = sys_get_temp_dir().'/composer_archiver/'.$this->manager->getPackageFilename($package); $this->assertFileNotExists($tmppath); diff --git a/tests/Composer/Test/Plugin/PluginInstallerTest.php b/tests/Composer/Test/Plugin/PluginInstallerTest.php index 2502dded9..08d0d1aab 100644 --- a/tests/Composer/Test/Plugin/PluginInstallerTest.php +++ b/tests/Composer/Test/Plugin/PluginInstallerTest.php @@ -17,7 +17,6 @@ use Composer\Config; use Composer\Installer\PluginInstaller; use Composer\Package\Loader\JsonLoader; use Composer\Package\Loader\ArrayLoader; -use Composer\Package\PackageInterface; use Composer\Plugin\PluginManager; use Composer\Autoload\AutoloadGenerator; use Composer\Util\Filesystem; @@ -166,4 +165,3 @@ class PluginInstallerTest extends \PHPUnit_Framework_TestCase $this->assertEquals('installer-v3', $plugins[1]->version); } } - diff --git a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php index 5b0bc43f9..0c2ba757e 100644 --- a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php @@ -1,4 +1,5 @@ assertEquals('//depot/branch', $stream); } - public function testGetStreamWithoutLabelWithStreamWithoutLabel() { $stream = $this->perforce->getStreamWithoutLabel('//depot/branch'); @@ -123,6 +122,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = 'P4USER=TEST_P4VARIABLE_USER' . PHP_EOL ; + return true; } ) @@ -146,6 +146,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = 'TEST_P4VARIABLE_USER' . PHP_EOL; + return true; } ) @@ -237,6 +238,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = 'P4PASSWD=TEST_P4VARIABLE_PASSWORD' . PHP_EOL; + return true; } ) @@ -260,6 +262,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = 'TEST_P4VARIABLE_PASSWORD' . PHP_EOL; + return true; } ) @@ -357,6 +360,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL; + return true; } ) @@ -382,6 +386,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL; + return true; } ) @@ -404,6 +409,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL; + return true; } ) @@ -428,6 +434,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = 'Depot depot 2013/06/25 stream /p4/1/depots/depot/... \'Created by Me\''; + return true; } ) @@ -447,6 +454,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = PerforceTest::getComposerJson(); + return true; } ) @@ -472,6 +480,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = '//depot/composer.json#1 - branch change 10001 (text)'; + return true; } ) @@ -485,6 +494,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = PerforceTest::getComposerJson(); + return true; } ) @@ -513,6 +523,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = PerforceTest::getComposerJson(); + return true; } ) @@ -540,6 +551,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = '//depot/composer.json#1 - branch change 10001 (text)'; + return true; } ) @@ -553,6 +565,7 @@ class PerforceTest extends \PHPUnit_Framework_TestCase $this->returnCallback( function ($command, &$output) { $output = PerforceTest::getComposerJson(); + return true; } ) diff --git a/tests/Composer/Test/Util/RemoteFilesystemTest.php b/tests/Composer/Test/Util/RemoteFilesystemTest.php index eb8ebc07e..67696b40f 100644 --- a/tests/Composer/Test/Util/RemoteFilesystemTest.php +++ b/tests/Composer/Test/Util/RemoteFilesystemTest.php @@ -144,7 +144,6 @@ class RemoteFilesystemTest extends \PHPUnit_Framework_TestCase } } - public function testCaptureAuthenticationParamsFromUrl() { $io = $this->getMock('Composer\IO\IOInterface');