main
Jordi Boggiano 12 years ago
parent b566ba77ac
commit 66e9dcddf4

@ -132,7 +132,7 @@ EOF;
if ($includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $relVendorPath, $vendorPath, $vendorPathCode, $appBaseDirCode)) { if ($includePathFile = $this->getIncludePathsFile($packageMap, $filesystem, $relVendorPath, $vendorPath, $vendorPathCode, $appBaseDirCode)) {
file_put_contents($targetDir.'/include_paths.php', $includePathFile); file_put_contents($targetDir.'/include_paths.php', $includePathFile);
} }
file_put_contents($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, true, true, (Boolean) $includePathFile, $targetDirLoader, $filesCode)); file_put_contents($vendorPath.'/autoload.php', $this->getAutoloadFile($vendorPathToTargetDirCode, true, true, (bool) $includePathFile, $targetDirLoader, $filesCode));
copy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php'); copy(__DIR__.'/ClassLoader.php', $targetDir.'/ClassLoader.php');
} }

@ -102,7 +102,7 @@ class ClassLoader
/** /**
* Turns on searching the include path for class files. * Turns on searching the include path for class files.
* *
* @param Boolean $useIncludePath * @param bool $useIncludePath
*/ */
public function setUseIncludePath($useIncludePath) public function setUseIncludePath($useIncludePath)
{ {
@ -113,7 +113,7 @@ class ClassLoader
* Can be used to check if the autoloader uses the include path to check * Can be used to check if the autoloader uses the include path to check
* for classes. * for classes.
* *
* @return Boolean * @return bool
*/ */
public function getUseIncludePath() public function getUseIncludePath()
{ {
@ -123,7 +123,7 @@ class ClassLoader
/** /**
* Registers this instance as an autoloader. * Registers this instance as an autoloader.
* *
* @param Boolean $prepend Whether to prepend the autoloader or not * @param bool $prepend Whether to prepend the autoloader or not
*/ */
public function register($prepend = false) public function register($prepend = false)
{ {
@ -142,7 +142,7 @@ class ClassLoader
* Loads the given class or interface. * Loads the given class or interface.
* *
* @param string $class The name of the class * @param string $class The name of the class
* @return Boolean|null True, if loaded * @return bool|null True, if loaded
*/ */
public function loadClass($class) public function loadClass($class)
{ {

@ -27,18 +27,18 @@ use Symfony\Component\Console\Command\Command as BaseCommand;
abstract class Command extends BaseCommand abstract class Command extends BaseCommand
{ {
/** /**
* @var \Composer\Composer * @var Composer
*/ */
private $composer; private $composer;
/** /**
* @var \Composer\IO\IOInterface * @var IOInterface
*/ */
private $io; private $io;
/** /**
* @param bool $required * @param bool $required
* @return \Composer\Composer * @return Composer
*/ */
public function getComposer($required = true) public function getComposer($required = true)
{ {
@ -59,7 +59,7 @@ abstract class Command extends BaseCommand
} }
/** /**
* @param \Composer\Composer $composer * @param Composer $composer
*/ */
public function setComposer(Composer $composer) public function setComposer(Composer $composer)
{ {
@ -67,7 +67,7 @@ abstract class Command extends BaseCommand
} }
/** /**
* @return \Composer\IO\IOInterface * @return IOInterface
*/ */
public function getIO() public function getIO()
{ {
@ -85,7 +85,7 @@ abstract class Command extends BaseCommand
} }
/** /**
* @param \Composer\IO\IOInterface $io * @param IOInterface $io
*/ */
public function setIO(IOInterface $io) public function setIO(IOInterface $io)
{ {

@ -74,7 +74,7 @@ EOT
$needle = $input->getArgument('package'); $needle = $input->getArgument('package');
$references = array(); $references = array();
$verbose = (Boolean) $input->getOption('verbose'); $verbose = (bool) $input->getOption('verbose');
$repos = $composer->getRepositoryManager()->getRepositories(); $repos = $composer->getRepositoryManager()->getRepositories();
$types = $input->getOption('link-type'); $types = $input->getOption('link-type');

@ -381,7 +381,7 @@ EOT
* @param string $ignoreFile * @param string $ignoreFile
* @param string $vendor * @param string $vendor
* *
* @return Boolean * @return bool
*/ */
protected function hasVendorIgnore($ignoreFile, $vendor = 'vendor') protected function hasVendorIgnore($ignoreFile, $vendor = 'vendor')
{ {

@ -72,7 +72,7 @@ class Config
* Checks whether a setting exists * Checks whether a setting exists
* *
* @param string $key * @param string $key
* @return Boolean * @return bool
*/ */
public function has($key) public function has($key)
{ {

@ -30,7 +30,7 @@ class DownloadManager
/** /**
* Initializes download manager. * Initializes download manager.
* *
* @param Boolean $preferSource prefer downloading from source * @param bool $preferSource prefer downloading from source
*/ */
public function __construct($preferSource = false, Filesystem $filesystem = null) public function __construct($preferSource = false, Filesystem $filesystem = null)
{ {
@ -41,7 +41,7 @@ class DownloadManager
/** /**
* Makes downloader prefer source installation over the dist. * Makes downloader prefer source installation over the dist.
* *
* @param Boolean $preferSource prefer downloading from source * @param bool $preferSource prefer downloading from source
*/ */
public function setPreferSource($preferSource) public function setPreferSource($preferSource)
{ {
@ -123,7 +123,7 @@ class DownloadManager
* *
* @param PackageInterface $package package instance * @param PackageInterface $package package instance
* @param string $targetDir target dir * @param string $targetDir target dir
* @param Boolean $preferSource prefer installation from source * @param bool $preferSource prefer installation from source
* *
* @throws InvalidArgumentException if package have no urls to download from * @throws InvalidArgumentException if package have no urls to download from
*/ */

@ -154,7 +154,7 @@ class Factory
} }
/** /**
* @param IO\IOInterface $io * @param IOInterface $io
* @param Config $config * @param Config $config
* @return Repository\RepositoryManager * @return Repository\RepositoryManager
*/ */

@ -65,7 +65,7 @@ class ConsoleIO implements IOInterface
*/ */
public function isVerbose() public function isVerbose()
{ {
return (Boolean) $this->input->getOption('verbose'); return (bool) $this->input->getOption('verbose');
} }
/** /**

@ -22,21 +22,21 @@ interface IOInterface
/** /**
* Is this input means interactive? * Is this input means interactive?
* *
* @return Boolean * @return bool
*/ */
public function isInteractive(); public function isInteractive();
/** /**
* Is this input verbose? * Is this input verbose?
* *
* @return Boolean * @return bool
*/ */
public function isVerbose(); public function isVerbose();
/** /**
* Is this output decorated? * Is this output decorated?
* *
* @return Boolean * @return bool
*/ */
public function isDecorated(); public function isDecorated();
@ -44,7 +44,7 @@ interface IOInterface
* Writes a message to the output. * Writes a message to the output.
* *
* @param string|array $messages The message as an array of lines or a single string * @param string|array $messages The message as an array of lines or a single string
* @param Boolean $newline Whether to add a newline or not * @param bool $newline Whether to add a newline or not
*/ */
public function write($messages, $newline = true); public function write($messages, $newline = true);
@ -52,7 +52,7 @@ interface IOInterface
* Overwrites a previous message to the output. * Overwrites a previous message to the output.
* *
* @param string|array $messages The message as an array of lines or a single string * @param string|array $messages The message as an array of lines or a single string
* @param Boolean $newline Whether to add a newline or not * @param bool $newline Whether to add a newline or not
* @param integer $size The size of line * @param integer $size The size of line
*/ */
public function overwrite($messages, $newline = true, $size = 80); public function overwrite($messages, $newline = true, $size = 80);
@ -75,9 +75,9 @@ interface IOInterface
* The question will be asked until the user answers by nothing, yes, or no. * The question will be asked until the user answers by nothing, yes, or no.
* *
* @param string|array $question The question to ask * @param string|array $question The question to ask
* @param Boolean $default The default answer if the user enters nothing * @param bool $default The default answer if the user enters nothing
* *
* @return Boolean true if the user has confirmed, false otherwise * @return bool true if the user has confirmed, false otherwise
*/ */
public function askConfirmation($question, $default = true); public function askConfirmation($question, $default = true);

@ -102,7 +102,7 @@ class InstallationManager
* @param InstalledRepositoryInterface $repo repository in which to check * @param InstalledRepositoryInterface $repo repository in which to check
* @param PackageInterface $package package instance * @param PackageInterface $package package instance
* *
* @return Boolean * @return bool
*/ */
public function isPackageInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) public function isPackageInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)
{ {

@ -27,7 +27,7 @@ interface InstallerInterface
* Decides if the installer supports the given type * Decides if the installer supports the given type
* *
* @param string $packageType * @param string $packageType
* @return Boolean * @return bool
*/ */
public function supports($packageType); public function supports($packageType);
@ -37,7 +37,7 @@ interface InstallerInterface
* @param InstalledRepositoryInterface $repo repository in which to check * @param InstalledRepositoryInterface $repo repository in which to check
* @param PackageInterface $package package instance * @param PackageInterface $package package instance
* *
* @return Boolean * @return bool
*/ */
public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package); public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package);

@ -37,7 +37,7 @@ class ProjectInstaller implements InstallerInterface
* Decides if the installer supports the given type * Decides if the installer supports the given type
* *
* @param string $packageType * @param string $packageType
* @return Boolean * @return bool
*/ */
public function supports($packageType) public function supports($packageType)
{ {

@ -60,7 +60,7 @@ class JsonFile
/** /**
* Checks whether json file exists. * Checks whether json file exists.
* *
* @return Boolean * @return bool
*/ */
public function exists() public function exists()
{ {
@ -117,7 +117,7 @@ class JsonFile
* Validates the schema of the current json file according to composer-schema.json rules * Validates the schema of the current json file according to composer-schema.json rules
* *
* @param int $schema a JsonFile::*_SCHEMA constant * @param int $schema a JsonFile::*_SCHEMA constant
* @return Boolean true on success * @return bool true on success
* @throws \UnexpectedValueException * @throws \UnexpectedValueException
*/ */
public function validateSchema($schema = self::STRICT_SCHEMA) public function validateSchema($schema = self::STRICT_SCHEMA)
@ -174,9 +174,9 @@ class JsonFile
$json = json_encode($data); $json = json_encode($data);
$prettyPrint = (Boolean) ($options & self::JSON_PRETTY_PRINT); $prettyPrint = (bool) ($options & self::JSON_PRETTY_PRINT);
$unescapeUnicode = (Boolean) ($options & self::JSON_UNESCAPED_UNICODE); $unescapeUnicode = (bool) ($options & self::JSON_UNESCAPED_UNICODE);
$unescapeSlashes = (Boolean) ($options & self::JSON_UNESCAPED_SLASHES); $unescapeSlashes = (bool) ($options & self::JSON_UNESCAPED_SLASHES);
if (!$prettyPrint && !$unescapeUnicode && !$unescapeSlashes) { if (!$prettyPrint && !$unescapeUnicode && !$unescapeSlashes) {
return $json; return $json;
@ -282,7 +282,7 @@ class JsonFile
* Validates the syntax of a JSON string * Validates the syntax of a JSON string
* *
* @param string $json * @param string $json
* @return Boolean true on success * @return bool true on success
* @throws \UnexpectedValueException * @throws \UnexpectedValueException
*/ */
protected static function validateSyntax($json) protected static function validateSyntax($json)

@ -159,7 +159,7 @@ class AliasPackage extends BasePackage
* *
* Use by the policy for sorting manually aliased packages first, see #576 * Use by the policy for sorting manually aliased packages first, see #576
* *
* @param Boolean $value * @param bool $value
*/ */
public function setRootPackageAlias($value) public function setRootPackageAlias($value)
{ {
@ -168,7 +168,7 @@ class AliasPackage extends BasePackage
/** /**
* @see setRootPackageAlias * @see setRootPackageAlias
* @return Boolean * @return bool
*/ */
public function isRootPackageAlias() public function isRootPackageAlias()
{ {

@ -51,8 +51,8 @@ class Locker
/** /**
* Checks whether locker were been locked (lockfile found). * Checks whether locker were been locked (lockfile found).
* *
* @param Boolean $dev true to check if dev packages are locked * @param bool $dev true to check if dev packages are locked
* @return Boolean * @return bool
*/ */
public function isLocked($dev = false) public function isLocked($dev = false)
{ {
@ -71,7 +71,7 @@ class Locker
/** /**
* Checks whether the lock file is still up to date with the current hash * Checks whether the lock file is still up to date with the current hash
* *
* @return Boolean * @return bool
*/ */
public function isFresh() public function isFresh()
{ {
@ -83,7 +83,7 @@ class Locker
/** /**
* Searches and returns an array of locked packages, retrieved from registered repositories. * Searches and returns an array of locked packages, retrieved from registered repositories.
* *
* @param Boolean $dev true to retrieve the locked dev packages * @param bool $dev true to retrieve the locked dev packages
* @return array * @return array
*/ */
public function getLockedPackages($dev = false) public function getLockedPackages($dev = false)
@ -170,7 +170,7 @@ class Locker
* @param mixed $packages array of dev packages or null if installed without --dev * @param mixed $packages array of dev packages or null if installed without --dev
* @param array $aliases array of aliases * @param array $aliases array of aliases
* *
* @return Boolean * @return bool
*/ */
public function setLockData(array $packages, $devPackages, array $aliases, $minimumStability, array $stabilityFlags) public function setLockData(array $packages, $devPackages, array $aliases, $minimumStability, array $stabilityFlags)
{ {

@ -71,7 +71,7 @@ interface PackageInterface
/** /**
* Returns whether the package is a development virtual package or a concrete one * Returns whether the package is a development virtual package or a concrete one
* *
* @return Boolean * @return bool
*/ */
public function isDev(); public function isDev();

@ -110,7 +110,7 @@ class CompositeRepository implements RepositoryInterface
*/ */
public function removePackage(PackageInterface $package) public function removePackage(PackageInterface $package)
{ {
foreach($this->repositories as $repository) { foreach ($this->repositories as $repository) {
/* @var $repository RepositoryInterface */ /* @var $repository RepositoryInterface */
$repository->removePackage($package); $repository->removePackage($package);
} }

@ -20,7 +20,6 @@ use Composer\Package\Version\VersionParser;
*/ */
class PlatformRepository extends ArrayRepository class PlatformRepository extends ArrayRepository
{ {
protected function initialize() protected function initialize()
{ {
parent::initialize(); parent::initialize();

@ -27,7 +27,7 @@ interface RepositoryInterface extends \Countable
* *
* @param PackageInterface $package package instance * @param PackageInterface $package package instance
* *
* @return Boolean * @return bool
*/ */
public function hasPackage(PackageInterface $package); public function hasPackage(PackageInterface $package);

@ -57,7 +57,7 @@ abstract class VcsDriver implements VcsDriverInterface
public function hasComposerFile($identifier) public function hasComposerFile($identifier)
{ {
try { try {
return (Boolean) $this->getComposerInformation($identifier); return (bool) $this->getComposerInformation($identifier);
} catch (TransportException $e) { } catch (TransportException $e) {
} }
@ -94,6 +94,6 @@ abstract class VcsDriver implements VcsDriverInterface
protected static function isLocalUrl($url) protected static function isLocalUrl($url)
{ {
return (Boolean) preg_match('{^(file://|/|[a-z]:[\\\\/])}i', $url); return (bool) preg_match('{^(file://|/|[a-z]:[\\\\/])}i', $url);
} }
} }

@ -86,8 +86,8 @@ interface VcsDriverInterface
* *
* @param IOInterface $io IO instance * @param IOInterface $io IO instance
* @param string $url * @param string $url
* @param Boolean $shallow unless true, only shallow checks (url matching typically) should be done * @param bool $shallow unless true, only shallow checks (url matching typically) should be done
* @return Boolean * @return bool
*/ */
public static function supports(IOInterface $io, $url, $deep = false); public static function supports(IOInterface $io, $url, $deep = false);
} }

@ -58,7 +58,7 @@ class Filesystem
* *
* @param string $from * @param string $from
* @param string $to * @param string $to
* @param Boolean $directories if true, the source/target are considered to be directories * @param bool $directories if true, the source/target are considered to be directories
* @return string * @return string
*/ */
public function findShortestPath($from, $to, $directories = false) public function findShortestPath($from, $to, $directories = false)
@ -99,7 +99,7 @@ class Filesystem
* *
* @param string $from * @param string $from
* @param string $to * @param string $to
* @param Boolean $directories if true, the source/target are considered to be directories * @param bool $directories if true, the source/target are considered to be directories
* @return string * @return string
*/ */
public function findShortestPathCode($from, $to, $directories = false) public function findShortestPathCode($from, $to, $directories = false)
@ -139,7 +139,7 @@ class Filesystem
* Checks if the given path is absolute * Checks if the given path is absolute
* *
* @param string $path * @param string $path
* @return Boolean * @return bool
*/ */
public function isAbsolutePath($path) public function isAbsolutePath($path)
{ {

@ -49,7 +49,7 @@ class RemoteFilesystem
* @param string $fileName the local filename * @param string $fileName the local filename
* @param boolean $progress Display the progression * @param boolean $progress Display the progression
* *
* @return Boolean true * @return bool true
*/ */
public function copy($originUrl, $fileUrl, $fileName, $progress = true) public function copy($originUrl, $fileUrl, $fileName, $progress = true)
{ {
@ -136,7 +136,7 @@ class RemoteFilesystem
// handle copy command if download was successful // handle copy command if download was successful
if (false !== $result && null !== $fileName) { if (false !== $result && null !== $fileName) {
$result = (Boolean) @file_put_contents($fileName, $result); $result = (bool) @file_put_contents($fileName, $result);
if (false === $result) { if (false === $result) {
throw new TransportException('The "'.$fileUrl.'" file could not be written to '.$fileName); throw new TransportException('The "'.$fileUrl.'" file could not be written to '.$fileName);
} }

@ -70,7 +70,7 @@ class Svn
* @param string $url SVN url * @param string $url SVN url
* @param string $cwd Working directory * @param string $cwd Working directory
* @param string $path Target for a checkout * @param string $path Target for a checkout
* @param Boolean $verbose Output all output to the user * @param bool $verbose Output all output to the user
* *
* @return string * @return string
* *
@ -226,7 +226,7 @@ class Svn
* *
* @param string $url * @param string $url
* *
* @return Boolean * @return bool
*/ */
protected function hasAuth() protected function hasAuth()
{ {

Loading…
Cancel
Save