main
Jordi Boggiano 4 years ago
parent 152694b574
commit b7d770659b
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -695,6 +695,7 @@ EOF;
$version = str_replace('-', '.', $bound->getVersion());
$chunks = array_map('intval', explode('.', $version));
return $chunks[0] * 10000 + $chunks[1] * 100 + $chunks[2];
};
@ -710,6 +711,7 @@ EOF;
$version = str_replace('-', '.', $bound->getVersion());
$chunks = explode('.', $version);
$chunks = array_slice($chunks, 0, 3);
return implode('.', $chunks);
};

@ -51,7 +51,7 @@ class ClassMapGenerator
* Iterate over all files in the given directory searching for classes
*
* @param \Iterator|string $path The path to search in or an iterator
* @param string $excluded Regex that matches against the file path that exclude from the classmap.
* @param string $excluded Regex that matches against the file path that exclude from the classmap.
* @param IOInterface $io IO object
* @param string $namespace Optional namespace prefix to filter by
* @param string $autoloadType psr-0|psr-4 Optional autoload standard to use mapping rules
@ -147,13 +147,13 @@ class ClassMapGenerator
/**
* Remove classes which could not have been loaded by namespace autoloaders
*
* @param array $classes found classes in given file
* @param string $filePath current file
* @param string $baseNamespace prefix of given autoload mapping
* @param string $namespaceType psr-0|psr-4
* @param string $basePath root directory of given autoload mapping
* @param IOInterface $io IO object
* @return array valid classes
* @param array $classes found classes in given file
* @param string $filePath current file
* @param string $baseNamespace prefix of given autoload mapping
* @param string $namespaceType psr-0|psr-4
* @param string $basePath root directory of given autoload mapping
* @param IOInterface $io IO object
* @return array valid classes
*/
private static function filterByNamespace($classes, $filePath, $baseNamespace, $namespaceType, $basePath, $io)
{
@ -176,8 +176,7 @@ class ClassMapGenerator
$className = substr($class, $namespaceLength + 1);
$subPath = str_replace('\\', DIRECTORY_SEPARATOR, $namespace)
. str_replace('_', DIRECTORY_SEPARATOR, $className);
}
else {
} else {
$subPath = str_replace('_', DIRECTORY_SEPARATOR, $class);
}
} elseif ('psr-4' === $namespaceType) {

@ -209,6 +209,7 @@ class Cache
{
if ($this->enabled) {
$this->filesystem->emptyDirectory($this->root);
return true;
}

@ -13,7 +13,6 @@
namespace Composer\Command;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
use Composer\Semver\Constraint\Constraint;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;

@ -16,7 +16,6 @@ use Composer\Config;
use Composer\Factory;
use Composer\Installer;
use Composer\Installer\ProjectInstaller;
use Composer\Installer\InstallationManager;
use Composer\Installer\SuggestedPackagesReporter;
use Composer\IO\IOInterface;
use Composer\Package\BasePackage;
@ -39,9 +38,7 @@ use Composer\Json\JsonFile;
use Composer\Config\JsonConfigSource;
use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor;
use Composer\Util\Loop;
use Composer\Package\Version\VersionParser;
use Composer\EventDispatcher\EventDispatcher;
/**
* Install a package as new project into new directory.

@ -677,7 +677,6 @@ EOT
return !$warnings && !$errors ? true : $output;
}
/**
* Check if allow_url_fopen is ON
*

@ -18,7 +18,6 @@ use Composer\Package\BasePackage;
use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Repository\CompositeRepository;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
/**

@ -845,7 +845,6 @@ EOT
} catch (\Exception $e) {
$this->getIO()->writeError('Could not install dependencies. Run `composer install` to see more information.');
}
}
private function hasDependencies($options)

@ -275,6 +275,7 @@ EOT
foreach ($packages as $package) {
if ($composer->getRepositoryManager()->getLocalRepository()->findPackages($package)) {
$io->writeError('<error>Removal failed, '.$package.' is still present, it may be required by another package. See `composer why '.$package.'`.</error>');
return 2;
}
}

@ -269,7 +269,6 @@ EOT
$rootPackage->setDevRequires($links['require-dev']);
}
$updateDevMode = !$input->getOption('update-no-dev');
$optimize = $input->getOption('optimize-autoloader') || $composer->getConfig()->get('optimize-autoloader');
$authoritative = $input->getOption('classmap-authoritative') || $composer->getConfig()->get('classmap-authoritative');

@ -397,11 +397,11 @@ TAGSPUBKEY
/**
* Checks if the downloaded/rollback phar is valid then moves it
*
* @param string $localFilename The composer.phar location
* @param string $newFilename The downloaded or backup phar
* @param string $backupTarget The filename to use for the backup
* @param string $localFilename The composer.phar location
* @param string $newFilename The downloaded or backup phar
* @param string $backupTarget The filename to use for the backup
* @throws FilesystemException If the file cannot be moved
* @return bool Whether the phar is valid and has been moved
* @return bool Whether the phar is valid and has been moved
*/
protected function setLocalPhar($localFilename, $newFilename, $backupTarget = null)
{
@ -482,14 +482,14 @@ TAGSPUBKEY
/**
* Validates the downloaded/backup phar file
*
* @param string $pharFile The downloaded or backup phar
* @param null|string $error Set by method on failure
* @param string $pharFile The downloaded or backup phar
* @param null|string $error Set by method on failure
*
* Code taken from getcomposer.org/installer. Any changes should be made
* there and replicated here
*
* @return bool If the operation succeeded
* @throws \Exception
* @return bool If the operation succeeded
*/
protected function validatePhar($pharFile, &$error)
{
@ -536,9 +536,9 @@ TAGSPUBKEY
*
* Uses a .vbs script to elevate and run the cmd.exe move command.
*
* @param string $localFilename The composer.phar location
* @param string $newFilename The downloaded or backup phar
* @return bool Whether composer.phar has been updated
* @param string $localFilename The composer.phar location
* @param string $newFilename The downloaded or backup phar
* @return bool Whether composer.phar has been updated
*/
protected function tryAsWindowsAdmin($localFilename, $newFilename)
{

@ -160,6 +160,7 @@ EOT
$package = $this->getComposer()->getPackage();
if ($input->getOption('name-only')) {
$io->write($package->getName());
return 0;
}
$repos = $installedRepo = new InstalledRepository(array(new RootPackageRepository($package)));
@ -207,7 +208,9 @@ EOT
if ($input->getOption('no-dev')) {
$packages = $this->filterRequiredPackages($installedRepo, $rootPkg);
$repos = $installedRepo = new InstalledRepository(array(new InstalledArrayRepository(array_map(function ($pkg) { return clone $pkg; }, $packages))));
$repos = $installedRepo = new InstalledRepository(array(new InstalledArrayRepository(array_map(function ($pkg) {
return clone $pkg;
}, $packages))));
}
if (!$installedRepo->getPackages() && ($rootPkg->getRequires() || $rootPkg->getDevRequires())) {
@ -798,7 +801,7 @@ EOT
'keywords' => $package->getKeywords() ?: array(),
'type' => $package->getType(),
'homepage' => $package->getHomepage(),
'names' => $package->getNames()
'names' => $package->getNames(),
);
$json = $this->appendVersions($json, $versions);
@ -814,7 +817,7 @@ EOT
$json['source'] = array(
'type' => $package->getSourceType(),
'url' => $package->getSourceUrl(),
'reference' => $package->getSourceReference()
'reference' => $package->getSourceReference(),
);
}
@ -822,7 +825,7 @@ EOT
$json['dist'] = array(
'type' => $package->getDistType(),
'url' => $package->getDistUrl(),
'reference' => $package->getDistReference()
'reference' => $package->getDistReference(),
);
}
@ -880,7 +883,7 @@ EOT
return array(
'name' => $license[0],
'osi' => $licenseId,
'url' => $license[2]
'url' => $license[2],
);
}, $licenses);
}

@ -82,7 +82,7 @@ EOT
}
/**
* @param InputInterface $input
* @param InputInterface $input
* @return int
*/
private function doExecute(InputInterface $input)

@ -175,6 +175,7 @@ EOT
if ($updateMirrors && !empty($packages)) {
$io->writeError('<error>You cannot simultaneously update only a selection of packages and regenerate the lock file metadata.</error>');
return -1;
}
@ -299,6 +300,7 @@ EOT
$oldPrettyString = $link->getConstraint()->getPrettyString();
$newConstraint = MultiConstraint::create(array($link->getConstraint(), $parser->parseConstraints($constraint)));
$newConstraint->setPrettyString($oldPrettyString.', '.$constraint);
return new Link(
$link->getSource(),
$link->getTarget(),

@ -13,7 +13,6 @@
namespace Composer;
use Composer\Json\JsonFile;
use Composer\Spdx\SpdxLicenses;
use Composer\CaBundle\CaBundle;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Process\Process;
@ -208,7 +207,7 @@ class Compiler
array(
'@package_version@' => $this->version,
'@package_branch_alias_version@' => $this->branchAliasVersion,
'@release_date@' => $this->versionDate->format('Y-m-d H:i:s')
'@release_date@' => $this->versionDate->format('Y-m-d H:i:s'),
)
);
$content = preg_replace('{SOURCE_VERSION = \'[^\']+\';}', 'SOURCE_VERSION = \'\';', $content);

@ -248,6 +248,7 @@ class Config
if (false === $val) {
$val = $this->config[$key];
}
return $val !== 'false' && (bool) $val;
// booleans without env var support

@ -38,7 +38,7 @@ interface ConfigSourceInterface
/**
* Add a config setting
*
* @param string $name Name
* @param string $name Name
* @param string|array $value Value
*/
public function addConfigSetting($name, $value);

@ -252,7 +252,7 @@ class JsonConfigSource implements ConfigSourceInterface
$this->arrayUnshiftRef($args, $config);
call_user_func_array($fallback, $args);
// avoid ending up with arrays for keys that should be objects
foreach (array('require', 'require-dev', 'conflict', 'provide', 'replace', 'suggest', 'config', 'autoload', 'autoload-dev', 'scripts', 'scripts-descriptions', 'support', ) as $prop) {
foreach (array('require', 'require-dev', 'conflict', 'provide', 'replace', 'suggest', 'config', 'autoload', 'autoload-dev', 'scripts', 'scripts-descriptions', 'support') as $prop) {
if (isset($config[$prop]) && $config[$prop] === array()) {
$config[$prop] = new \stdClass;
}

@ -158,8 +158,8 @@ class Application extends BaseApplication
try {
$commandName = $this->find($name)->getName();
} catch (CommandNotFoundException $e) {
// we'll check command validity again later after plugins are loaded
$commandName = false;
// we'll check command validity again later after plugins are loaded
$commandName = false;
} catch (\InvalidArgumentException $e) {
}
}

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Console;
use Composer\IO\IOInterface;
@ -17,9 +27,9 @@ final class GithubActionError
}
/**
* @param string $message
* @param string $message
* @param null|string $file
* @param null|int $line
* @param null|int $line
*/
public function emit($message, $file = null, $line = null)
{

@ -206,6 +206,7 @@ class Decisions implements \Iterator, \Countable
$str .= $packageId.':'.$level.',';
}
$str .= ']';
return $str;
}
}

@ -12,14 +12,7 @@
namespace Composer\DependencyResolver;
use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation;
use Composer\DependencyResolver\Operation\UninstallOperation;
use Composer\Package\AliasPackage;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryInterface;
use Composer\Semver\Constraint\Constraint;
/**
* @author Nils Adermann <naderman@naderman.de>

@ -12,13 +12,8 @@
namespace Composer\DependencyResolver;
use Composer\DependencyResolver\Operation\OperationInterface;
use Composer\Package\AliasPackage;
use Composer\Package\RootAliasPackage;
use Composer\Package\RootPackageInterface;
use Composer\Repository\ArrayRepository;
use Composer\Repository\RepositoryInterface;
use Composer\Test\Repository\ArrayRepositoryTest;
/**
* @author Nils Adermann <naderman@naderman.de>
@ -50,7 +45,6 @@ class LockTransaction extends Transaction
$this->setResultPackages($pool, $decisions);
parent::__construct($this->presentMap, $this->resultPackages['all']);
}
// TODO make this a bit prettier instead of the two text indexes?

@ -68,6 +68,7 @@ class MultiConflictRule extends Rule
if ($rule instanceof MultiConflictRule) {
return $this->literals === $rule->getLiterals();
}
return false;
}

@ -13,7 +13,6 @@
namespace Composer\DependencyResolver\Operation;
use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface;
/**
* Solver install operation.

@ -13,7 +13,6 @@
namespace Composer\DependencyResolver\Operation;
use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface;
/**
* Solver install operation.

@ -29,7 +29,7 @@ interface OperationInterface
/**
* Serializes the operation in a human readable format
*
* @param bool $lock Whether this is an operation on the lock file
* @param bool $lock Whether this is an operation on the lock file
* @return string
*/
public function show($lock);

@ -12,8 +12,6 @@
namespace Composer\DependencyResolver\Operation;
use Composer\Package\PackageInterface;
/**
* Abstract operation class.
*

@ -20,5 +20,6 @@ use Composer\Package\PackageInterface;
interface PolicyInterface
{
public function versionCompare(PackageInterface $a, PackageInterface $b, $operator);
public function selectPreferredPackages(Pool $pool, array $literals, $requiredPackage = null);
}

@ -12,7 +12,6 @@
namespace Composer\DependencyResolver;
use Composer\Package\AliasPackage;
use Composer\Package\Version\VersionParser;
use Composer\Semver\CompilingMatcher;
use Composer\Semver\Constraint\ConstraintInterface;
@ -82,9 +81,9 @@ class Pool implements \Countable
/**
* Searches all packages providing the given package name and match the constraint
*
* @param string $name The package name to be searched for
* @param ConstraintInterface $constraint A constraint that all returned
* packages must match or null to return all
* @param string $name The package name to be searched for
* @param ConstraintInterface $constraint A constraint that all returned
* packages must match or null to return all
* @return PackageInterface[] A set of packages
*/
public function whatProvides($name, ConstraintInterface $constraint = null)
@ -141,9 +140,9 @@ class Pool implements \Countable
* Checks if the package matches the given constraint directly or through
* provided or replaced packages
*
* @param PackageInterface $candidate
* @param string $name Name of the package to be matched
* @param ConstraintInterface $constraint The constraint to verify
* @param PackageInterface $candidate
* @param string $name Name of the package to be matched
* @param ConstraintInterface $constraint The constraint to verify
* @return bool
*/
public function match($candidate, $name, ConstraintInterface $constraint = null)

@ -281,6 +281,7 @@ class PoolBuilder
}
$this->packagesToLoad[$name] = $constraint;
return;
}
@ -420,6 +421,7 @@ class PoolBuilder
private function isRootRequire(Request $request, $name)
{
$rootRequires = $request->getRequires();
return isset($rootRequires[$name]);
}
@ -503,4 +505,3 @@ class PoolBuilder
}
}
}

@ -156,7 +156,7 @@ class Problem
* Store a reason descriptor but ignore duplicates
*
* @param string $id A canonical identifier for the reason
* @param Rule $reason The reason descriptor
* @param Rule $reason The reason descriptor
*/
protected function addReason($id, Rule $reason)
{
@ -304,11 +304,13 @@ class Problem
$maxProviders = 20;
$providersStr = implode(array_map(function ($p) {
$description = $p['description'] ? ' '.substr($p['description'], 0, 100) : '';
return " - ${p['name']}".$description."\n";
}, count($providers) > $maxProviders+1 ? array_slice($providers, 0, $maxProviders) : $providers));
if (count($providers) > $maxProviders+1) {
$providersStr .= ' ... and '.(count($providers)-$maxProviders).' more.'."\n";
}, count($providers) > $maxProviders + 1 ? array_slice($providers, 0, $maxProviders) : $providers));
if (count($providers) > $maxProviders + 1) {
$providersStr .= ' ... and '.(count($providers) - $maxProviders).' more.'."\n";
}
return array("- Root composer.json requires $packageName".self::constraintToText($constraint).", it ", "could not be found in any version, but the following packages provide it:\n".$providersStr." Consider requiring one of these to satisfy the $packageName requirement.");
}
@ -347,7 +349,7 @@ class Problem
}
/**
* @param string[] $versions an array of pretty versions, with normalized versions as keys
* @param string[] $versions an array of pretty versions, with normalized versions as keys
* @return list<string> a list of pretty versions and '...' where versions were removed
*/
private static function condenseVersionList(array $versions, $max)
@ -403,7 +405,6 @@ class Problem
}
return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', it is ', 'satisfiable by '.self::getPackageList($nextRepoPackages, $isVerbose).' from '.$nextRepo->getRepoName().' but '.self::getPackageList($higherRepoPackages, $isVerbose).' from '.reset($higherRepoPackages)->getRepository()->getRepoName().' has higher repository priority. The packages with higher priority do not match your '.$reason.' and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.');
}
/**

@ -14,7 +14,6 @@ namespace Composer\DependencyResolver;
use Composer\Package\Package;
use Composer\Package\PackageInterface;
use Composer\Package\RootAliasPackage;
use Composer\Repository\LockArrayRepository;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\MatchAllConstraint;

@ -12,7 +12,6 @@
namespace Composer\DependencyResolver;
use Composer\Package\CompletePackage;
use Composer\Package\Link;
use Composer\Package\PackageInterface;
use Composer\Package\AliasPackage;
@ -279,14 +278,13 @@ abstract class Rule
return 'You can only install one version of a package, so only one of these can be installed: ' . $this->formatPackagesUnique($pool, $literals, $isVerbose) . '.';
case self::RULE_LEARNED:
/** @TODO currently still generates way too much output to be helpful, and in some cases can even lead to endless recursion
if (isset($learnedPool[$this->reasonData])) {
echo $this->reasonData."\n";
$learnedString = ', learned rules:' . Problem::formatDeduplicatedRules($learnedPool[$this->reasonData], ' ', $repositorySet, $request, $pool, $isVerbose, $installedMap, $learnedPool);
} else {
$learnedString = ' (reasoning unavailable)';
}
*/
/** @TODO currently still generates way too much output to be helpful, and in some cases can even lead to endless recursion */
// if (isset($learnedPool[$this->reasonData])) {
// echo $this->reasonData."\n";
// $learnedString = ', learned rules:' . Problem::formatDeduplicatedRules($learnedPool[$this->reasonData], ' ', $repositorySet, $request, $pool, $isVerbose, $installedMap, $learnedPool);
// } else {
// $learnedString = ' (reasoning unavailable)';
// }
$learnedString = ' (conflict analysis result)';
if (count($literals) === 1) {

@ -12,11 +12,9 @@
namespace Composer\DependencyResolver;
use Composer\Package\LinkConstraint\VersionConstraint;
use Composer\Package\PackageInterface;
use Composer\Package\AliasPackage;
use Composer\Repository\PlatformRepository;
use Composer\Semver\Constraint\Constraint;
/**
* @author Nils Adermann <naderman@naderman.de>
@ -49,7 +47,7 @@ class RuleSetGenerator
* reason for generating this rule
* @param mixed $reasonData Any data, e.g. the requirement name,
* that goes with the reason
* @return Rule|null The generated rule or null if tautological
* @return Rule|null The generated rule or null if tautological
*/
protected function createRequireRule(PackageInterface $package, array $providers, $reason, $reasonData = null)
{
@ -72,9 +70,9 @@ class RuleSetGenerator
* The rule is (A|B|C) with A, B and C different packages. If the given
* set of packages is empty an impossible rule is generated.
*
* @param array $packages The set of packages to choose from
* @param int $reason A RULE_* constant describing the reason for
* generating this rule
* @param array $packages The set of packages to choose from
* @param int $reason A RULE_* constant describing the reason for
* generating this rule
* @param array $reasonData Additional data like the root require or fix request info
* @return Rule The generated rule
*/
@ -100,7 +98,7 @@ class RuleSetGenerator
* reason for generating this rule
* @param mixed $reasonData Any data, e.g. the package name, that
* goes with the reason
* @return Rule|null The generated rule
* @return Rule|null The generated rule
*/
protected function createRule2Literals(PackageInterface $issuer, PackageInterface $provider, $reason, $reasonData = null)
{

@ -61,7 +61,6 @@ class RuleWatchGraph
$this->watchChains[$literal]->unshift($node);
}
}
}
/**
@ -151,8 +150,8 @@ class RuleWatchGraph
* The rule node's watched literals are updated accordingly.
*
* @param int $fromLiteral A literal the node used to watch
* @param int $toLiteral A literal the node should watch now
* @param RuleWatchNode $node The rule node to be moved
* @param int $toLiteral A literal the node should watch now
* @param RuleWatchNode $node The rule node to be moved
*/
protected function moveWatch($fromLiteral, $toLiteral, $node)
{

@ -15,7 +15,6 @@ namespace Composer\DependencyResolver;
use Composer\IO\IOInterface;
use Composer\Package\PackageInterface;
use Composer\Repository\PlatformRepository;
use Composer\Semver\Constraint\MultiConstraint;
/**
* @author Nils Adermann <naderman@naderman.de>
@ -58,9 +57,9 @@ class Solver
protected $io;
/**
* @param PolicyInterface $policy
* @param Pool $pool
* @param IOInterface $io
* @param PolicyInterface $policy
* @param Pool $pool
* @param IOInterface $io
*/
public function __construct(PolicyInterface $policy, Pool $pool, IOInterface $io)
{
@ -182,8 +181,8 @@ class Solver
}
/**
* @param Request $request
* @param bool|array $ignorePlatformReqs
* @param Request $request
* @param bool|array $ignorePlatformReqs
* @return LockTransaction
*/
public function solve(Request $request, $ignorePlatformReqs = false)

@ -68,6 +68,7 @@ class Transaction
// if names are the same, compare version, e.g. to sort aliases reliably, actual order does not matter
return strcmp($b->getVersion(), $a->getVersion());
}
return strcmp($b->getName(), $a->getName());
};
@ -230,6 +231,7 @@ class Transaction
if (!isset($this->resultPackagesByName[$link->getTarget()])) {
return array();
}
return $this->resultPackagesByName[$link->getTarget()];
}

@ -14,8 +14,6 @@ namespace Composer\Downloader;
use Composer\Package\PackageInterface;
use Symfony\Component\Finder\Finder;
use Composer\IO\IOInterface;
use Composer\Exception\IrrecoverableDownloadException;
use React\Promise\PromiseInterface;
use Composer\DependencyResolver\Operation\InstallOperation;
@ -28,7 +26,6 @@ use Composer\DependencyResolver\Operation\InstallOperation;
*/
abstract class ArchiveDownloader extends FileDownloader
{
/**
* {@inheritDoc}
* @throws \RuntimeException
@ -158,8 +155,8 @@ abstract class ArchiveDownloader extends FileDownloader
* @param string $file Extracted file
* @param string $path Directory
*
* @return PromiseInterface|null
* @throws \UnexpectedValueException If can not extract downloaded file to path
* @return PromiseInterface|null
*/
abstract protected function extract(PackageInterface $package, $file, $path);
}

@ -41,9 +41,9 @@ class DownloadManager
/**
* Initializes download manager.
*
* @param IOInterface $io The Input Output Interface
* @param bool $preferSource prefer downloading from source
* @param Filesystem|null $filesystem custom Filesystem object
* @param IOInterface $io The Input Output Interface
* @param bool $preferSource prefer downloading from source
* @param Filesystem|null $filesystem custom Filesystem object
*/
public function __construct(IOInterface $io, $preferSource = false, Filesystem $filesystem = null)
{
@ -171,13 +171,13 @@ class DownloadManager
/**
* Downloads package into target dir.
*
* @param PackageInterface $package package instance
* @param string $targetDir target dir
* @param PackageInterface|null $prevPackage previous package instance in case of updates
* @param PackageInterface $package package instance
* @param string $targetDir target dir
* @param PackageInterface|null $prevPackage previous package instance in case of updates
*
* @return PromiseInterface
* @throws \InvalidArgumentException if package have no urls to download from
* @throws \RuntimeException
* @return PromiseInterface
*/
public function download(PackageInterface $package, $targetDir, PackageInterface $prevPackage = null)
{
@ -242,10 +242,10 @@ class DownloadManager
/**
* Prepares an operation execution
*
* @param string $type one of install/update/uninstall
* @param PackageInterface $package package instance
* @param string $targetDir target dir
* @param PackageInterface|null $prevPackage previous package instance in case of updates
* @param string $type one of install/update/uninstall
* @param PackageInterface $package package instance
* @param string $targetDir target dir
* @param PackageInterface|null $prevPackage previous package instance in case of updates
*
* @return PromiseInterface|null
*/
@ -261,12 +261,12 @@ class DownloadManager
/**
* Installs package into target dir.
*
* @param PackageInterface $package package instance
* @param string $targetDir target dir
* @param PackageInterface $package package instance
* @param string $targetDir target dir
*
* @return PromiseInterface|null
* @throws \InvalidArgumentException if package have no urls to download from
* @throws \RuntimeException
* @return PromiseInterface|null
*/
public function install(PackageInterface $package, $targetDir)
{
@ -284,8 +284,8 @@ class DownloadManager
* @param PackageInterface $target target package version
* @param string $targetDir target dir
*
* @return PromiseInterface|null
* @throws \InvalidArgumentException if initial package is not installed
* @return PromiseInterface|null
*/
public function update(PackageInterface $initial, PackageInterface $target, $targetDir)
{
@ -324,6 +324,7 @@ class DownloadManager
$promise = $initialDownloader->remove($initial, $targetDir);
if ($promise) {
$self = $this;
return $promise->then(function ($res) use ($self, $target, $targetDir) {
return $self->install($target, $targetDir);
});
@ -352,10 +353,10 @@ class DownloadManager
/**
* Cleans up a failed operation
*
* @param string $type one of install/update/uninstall
* @param PackageInterface $package package instance
* @param string $targetDir target dir
* @param PackageInterface|null $prevPackage previous package instance in case of updates
* @param string $type one of install/update/uninstall
* @param PackageInterface $package package instance
* @param string $targetDir target dir
* @param PackageInterface|null $prevPackage previous package instance in case of updates
*
* @return PromiseInterface|null
*/

@ -29,7 +29,6 @@ use Composer\Util\Filesystem;
use Composer\Util\HttpDownloader;
use Composer\Util\Url as UrlUtil;
use Composer\Util\ProcessExecutor;
use Composer\Downloader\TransportException;
use React\Promise\PromiseInterface;
/**
@ -65,12 +64,12 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
/**
* Constructor.
*
* @param IOInterface $io The IO instance
* @param Config $config The config
* @param HttpDownloader $httpDownloader The remote filesystem
* @param EventDispatcher $eventDispatcher The event dispatcher
* @param Cache $cache Cache instance
* @param Filesystem $filesystem The filesystem
* @param IOInterface $io The IO instance
* @param Config $config The config
* @param HttpDownloader $httpDownloader The remote filesystem
* @param EventDispatcher $eventDispatcher The event dispatcher
* @param Cache $cache Cache instance
* @param Filesystem $filesystem The filesystem
*/
public function __construct(IOInterface $io, Config $config, HttpDownloader $httpDownloader, EventDispatcher $eventDispatcher = null, Cache $cache = null, Filesystem $filesystem = null, ProcessExecutor $process = null)
{
@ -121,7 +120,7 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
// from different packages, which would potentially allow a given package
// in a third party repo to pre-populate the cache for the same package in
// packagist for example.
'cacheKey' => $cacheKeyGenerator($package, $processedUrl)
'cacheKey' => $cacheKeyGenerator($package, $processedUrl),
);
}
@ -147,7 +146,7 @@ class FileDownloader implements DownloaderInterface, ChangeReportInterface
$eventDispatcher->dispatch($preFileDownloadEvent->getName(), $preFileDownloadEvent);
if ($preFileDownloadEvent->getCustomCacheKey() !== null) {
$url['cacheKey'] = $cacheKeyGenerator($package, $preFileDownloadEvent->getCustomCacheKey());
} else if ($preFileDownloadEvent->getProcessedUrl() !== $url['processed']) {
} elseif ($preFileDownloadEvent->getProcessedUrl() !== $url['processed']) {
$url['cacheKey'] = $cacheKeyGenerator($package, $preFileDownloadEvent->getProcessedUrl());
}
$url['processed'] = $preFileDownloadEvent->getProcessedUrl();

@ -25,7 +25,6 @@ class FossilDownloader extends VcsDownloader
*/
protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null)
{
}
/**

@ -488,7 +488,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
}
/**
* @param string $path
* @param string $path
* @throws \RuntimeException
*/
protected function discardChanges($path)
@ -502,7 +502,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
}
/**
* @param string $path
* @param string $path
* @throws \RuntimeException
*/
protected function stashChanges($path)
@ -516,7 +516,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
}
/**
* @param string $path
* @param string $path
* @throws \RuntimeException
*/
protected function viewDiff($path)

@ -12,15 +12,9 @@
namespace Composer\Downloader;
use Composer\Config;
use Composer\Cache;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Package\PackageInterface;
use Composer\Util\Platform;
use Composer\Util\ProcessExecutor;
use Composer\Util\HttpDownloader;
use Composer\IO\IOInterface;
use Composer\Util\Filesystem;
/**
* GZip archive downloader.

@ -26,7 +26,6 @@ class HgDownloader extends VcsDownloader
*/
protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null)
{
}
/**

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Downloader;
class MaxFileSizeExceededException extends TransportException

@ -18,16 +18,9 @@ use Composer\Package\PackageInterface;
use Composer\Package\Version\VersionGuesser;
use Composer\Package\Version\VersionParser;
use Composer\Util\Platform;
use Composer\IO\IOInterface;
use Composer\Config;
use Composer\Cache;
use Composer\Util\HttpDownloader;
use Composer\Util\ProcessExecutor;
use Composer\Util\Filesystem;
use Composer\EventDispatcher\EventDispatcher;
use Symfony\Component\Filesystem\Exception\IOException;
use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;
use Composer\DependencyResolver\Operation\UpdateOperation;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\DependencyResolver\Operation\UninstallOperation;

@ -29,7 +29,6 @@ class PerforceDownloader extends VcsDownloader
*/
protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null)
{
}
/**

@ -12,15 +12,9 @@
namespace Composer\Downloader;
use Composer\Config;
use Composer\Cache;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Util\IniHelper;
use Composer\Util\Platform;
use Composer\Util\ProcessExecutor;
use Composer\Util\HttpDownloader;
use Composer\Util\Filesystem;
use Composer\IO\IOInterface;
use Composer\Package\PackageInterface;
use RarArchive;

@ -30,7 +30,6 @@ class SvnDownloader extends VcsDownloader
*/
protected function doDownload(PackageInterface $package, $path, $url, PackageInterface $prevPackage = null)
{
}
/**

@ -12,14 +12,8 @@
namespace Composer\Downloader;
use Composer\Config;
use Composer\Cache;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Package\PackageInterface;
use Composer\Util\ProcessExecutor;
use Composer\Util\HttpDownloader;
use Composer\IO\IOInterface;
use Composer\Util\Filesystem;
/**
* Xz archive downloader.

@ -12,16 +12,10 @@
namespace Composer\Downloader;
use Composer\Config;
use Composer\Cache;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Package\PackageInterface;
use Composer\Util\IniHelper;
use Composer\Util\Platform;
use Composer\Util\ProcessExecutor;
use Composer\Util\Filesystem;
use Composer\Util\HttpDownloader;
use Composer\IO\IOInterface;
use Symfony\Component\Process\ExecutableFinder;
use ZipArchive;
@ -75,9 +69,9 @@ class ZipDownloader extends ArchiveDownloader
/**
* extract $file to $path with "unzip" command
*
* @param string $file File to extract
* @param string $path Path where to extract file
* @param bool $isLastChance If true it is called as a fallback and should throw an exception
* @param string $file File to extract
* @param string $path Path where to extract file
* @param bool $isLastChance If true it is called as a fallback and should throw an exception
*/
private function extractWithSystemUnzip(PackageInterface $package, $file, $path, $isLastChance, $async = false)
{
@ -160,9 +154,9 @@ class ZipDownloader extends ArchiveDownloader
/**
* extract $file to $path with ZipArchive
*
* @param string $file File to extract
* @param string $path Path where to extract file
* @param bool $isLastChance If true it is called as a fallback and should throw an exception
* @param string $file File to extract
* @param string $path Path where to extract file
* @param bool $isLastChance If true it is called as a fallback and should throw an exception
*
* TODO v3 should make this private once we can drop PHP 5.3 support
* @protected

@ -121,10 +121,10 @@ class EventDispatcher
/**
* Dispatch a installer event.
*
* @param string $eventName The constant in InstallerEvents
* @param bool $devMode Whether or not we are in dev mode
* @param bool $executeOperations True if operations will be executed, false in --dry-run
* @param Transaction $transaction The transaction contains the list of operations
* @param string $eventName The constant in InstallerEvents
* @param bool $devMode Whether or not we are in dev mode
* @param bool $executeOperations True if operations will be executed, false in --dry-run
* @param Transaction $transaction The transaction contains 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
@ -158,7 +158,6 @@ class EventDispatcher
$return = 0;
foreach ($listeners as $callable) {
$this->ensureBinDirIsInPath();
if (!is_string($callable)) {
@ -168,7 +167,7 @@ class EventDispatcher
throw new \RuntimeException('Subscriber '.$className.'::'.$callable[1].' for event '.$event->getName().' is not callable, make sure the function is defined and public');
}
if (is_array($callable) && (is_string($callable[0]) || is_object($callable[0])) && is_string($callable[1])) {
$this->io->writeError(sprintf('> %s: %s', $event->getName(), (is_object($callable[0]) ? get_class($callable[0]) : $callable[0]).'->'.$callable[1] ), true, IOInterface::VERBOSE);
$this->io->writeError(sprintf('> %s: %s', $event->getName(), (is_object($callable[0]) ? get_class($callable[0]) : $callable[0]).'->'.$callable[1]), true, IOInterface::VERBOSE);
}
$return = false === call_user_func($callable, $event) ? 1 : 0;
} elseif ($this->isComposerScript($callable)) {

@ -427,8 +427,8 @@ class Factory
}
/**
* @param IOInterface $io IO instance
* @param bool $disablePlugins Whether plugins should not be loaded
* @param IOInterface $io IO instance
* @param bool $disablePlugins Whether plugins should not be loaded
* @return Composer|null
*/
public static function createGlobal(IOInterface $io, $disablePlugins = false)
@ -598,9 +598,9 @@ class Factory
/**
* If you are calling this in a plugin, you probably should instead use $composer->getLoop()->getHttpDownloader()
*
* @param IOInterface $io IO instance
* @param Config $config Config instance
* @param array $options Array of options passed directly to HttpDownloader constructor
* @param IOInterface $io IO instance
* @param Config $config Config instance
* @param array $options Array of options passed directly to HttpDownloader constructor
* @return HttpDownloader
*/
public static function createHttpDownloader(IOInterface $io, Config $config, $options = array())

@ -255,7 +255,7 @@ class ConsoleIO extends BaseIO
}
/**
* @param int $max
* @param int $max
* @return ProgressBar
*/
public function getProgressBar($max = 0)

@ -179,7 +179,7 @@ interface IOInterface extends LoggerInterface
* @param bool $multiselect Select more than one value separated by comma
*
* @throws \InvalidArgumentException
* @return int|string|array|bool The selected value or values (the key of the choices array)
* @return int|string|array|bool The selected value or values (the key of the choices array)
*/
public function select($question, $choices, $default, $attempts = false, $errorMessage = 'Value "%s" is invalid', $multiselect = false);

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer;
use Composer\Semver\VersionParser;

@ -20,19 +20,14 @@ use Composer\DependencyResolver\LockTransaction;
use Composer\DependencyResolver\Operation\UpdateOperation;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\DependencyResolver\Operation\UninstallOperation;
use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation;
use Composer\DependencyResolver\Operation\OperationInterface;
use Composer\DependencyResolver\PolicyInterface;
use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\Request;
use Composer\DependencyResolver\Rule;
use Composer\DependencyResolver\Solver;
use Composer\DependencyResolver\SolverProblemsException;
use Composer\Downloader\DownloadManager;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Installer\InstallationManager;
use Composer\Installer\InstallerEvents;
use Composer\Installer\NoopInstaller;
use Composer\Installer\SuggestedPackagesReporter;
use Composer\IO\IOInterface;
use Composer\Package\AliasPackage;
@ -41,7 +36,6 @@ use Composer\Package\BasePackage;
use Composer\Package\CompletePackage;
use Composer\Package\CompletePackageInterface;
use Composer\Package\Link;
use Composer\Package\LinkConstraint\VersionConstraint;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Dumper\ArrayDumper;
use Composer\Package\Version\VersionParser;
@ -50,9 +44,7 @@ use Composer\Repository\ArrayRepository;
use Composer\Repository\RepositorySet;
use Composer\Semver\Constraint\Constraint;
use Composer\Package\Locker;
use Composer\Package\PackageInterface;
use Composer\Package\RootPackageInterface;
use Composer\Repository\CompositeRepository;
use Composer\Repository\InstalledArrayRepository;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Repository\InstalledRepository;
@ -376,6 +368,7 @@ class Installer
if ($this->updateAllowList) {
if (!$lockedRepository) {
$this->io->writeError('<error>Cannot update only a partial set of packages without a lock file present.</error>', true, IOInterface::QUIET);
return 1;
}
}
@ -612,9 +605,9 @@ class Installer
}
/**
* @param InstalledRepositoryInterface $localRepo
* @param bool $alreadySolved Whether the function is called as part of an update command or independently
* @return int exit code
* @param InstalledRepositoryInterface $localRepo
* @param bool $alreadySolved Whether the function is called as part of an update command or independently
* @return int exit code
*/
protected function doInstall(InstalledRepositoryInterface $localRepo, $alreadySolved = false)
{
@ -660,6 +653,7 @@ class Installer
// installing the locked packages on this platform resulted in lock modifying operations, there wasn't a conflict, but the lock file as-is seems to not work on this system
if (0 !== count($lockTransaction->getOperations())) {
$this->io->writeError('<error>Your lock file cannot be installed on this system without changes. Please run composer update.</error>', true, IOInterface::QUIET);
return 1;
}
} catch (SolverProblemsException $e) {
@ -743,10 +737,10 @@ class Installer
}
/**
* @param bool $forUpdate
* @param PlatformRepository $platformRepo
* @param array $rootAliases
* @param RepositoryInterface|null $lockedRepository
* @param bool $forUpdate
* @param PlatformRepository $platformRepo
* @param array $rootAliases
* @param RepositoryInterface|null $lockedRepository
* @return RepositorySet
*/
private function createRepositorySet($forUpdate, PlatformRepository $platformRepo, array $rootAliases = array(), $lockedRepository = null)
@ -821,9 +815,9 @@ class Installer
}
/**
* @param RootPackageInterface $rootPackage
* @param PlatformRepository $platformRepo
* @param RepositoryInterface|null $lockedRepository
* @param RootPackageInterface $rootPackage
* @param PlatformRepository $platformRepo
* @param RepositoryInterface|null $lockedRepository
* @return Request
*/
private function createRequest(RootPackageInterface $rootPackage, PlatformRepository $platformRepo, $lockedRepository = null)
@ -858,7 +852,7 @@ class Installer
}
/**
* @param bool $forUpdate
* @param bool $forUpdate
* @return array
*/
private function getRootAliases($forUpdate)
@ -1176,7 +1170,7 @@ class Installer
/**
* Update the lock file to the exact same versions and references but use current remote metadata like URLs and mirror info
*
* @param bool $updateMirrors
* @param bool $updateMirrors
* @return Installer
*/
public function setUpdateMirrors($updateMirrors)
@ -1206,7 +1200,7 @@ class Installer
* Depending on the chosen constant this will either only update the directly named packages, all transitive
* dependencies which are not root requirement or all transitive dependencies including root requirements
*
* @param int $updateAllowTransitiveDependencies One of the UPDATE_ constants on the Request class
* @param int $updateAllowTransitiveDependencies One of the UPDATE_ constants on the Request class
* @return Installer
*/
public function setUpdateAllowTransitiveDependencies($updateAllowTransitiveDependencies)

@ -25,7 +25,6 @@ use Composer\DependencyResolver\Operation\UninstallOperation;
use Composer\DependencyResolver\Operation\MarkAliasInstalledOperation;
use Composer\DependencyResolver\Operation\MarkAliasUninstalledOperation;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Util\StreamContextFactory;
use Composer\Util\Loop;
use React\Promise\PromiseInterface;
@ -293,7 +292,7 @@ class InstallationManager
}
/**
* @param array $operations List of operations to execute in this batch
* @param array $operations List of operations to execute in this batch
* @param array $allOperations Complete list of operations to be executed in the install job, used for event listeners
*/
private function downloadAndExecuteBatch(RepositoryInterface $repo, array $operations, array &$cleanupPromises, $devMode, $runScripts, array $allOperations)
@ -370,7 +369,7 @@ class InstallationManager
}
/**
* @param array $operations List of operations to execute in this batch
* @param array $operations List of operations to execute in this batch
* @param array $allOperations Complete list of operations to be executed in the install job, used for event listeners
*/
private function executeBatch(RepositoryInterface $repo, array $operations, array $cleanupPromises, $devMode, $runScripts, array $allOperations)

@ -13,13 +13,9 @@
namespace Composer\Installer;
use Composer\Composer;
use Composer\DependencyResolver\PolicyInterface;
use Composer\DependencyResolver\Request;
use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\Transaction;
use Composer\EventDispatcher\Event;
use Composer\IO\IOInterface;
use Composer\Repository\RepositorySet;
class InstallerEvent extends Event
{
@ -51,12 +47,12 @@ class InstallerEvent extends Event
/**
* Constructor.
*
* @param string $eventName
* @param Composer $composer
* @param IOInterface $io
* @param bool $devMode
* @param bool $executeOperations
* @param Transaction $transaction
* @param string $eventName
* @param Composer $composer
* @param IOInterface $io
* @param bool $devMode
* @param bool $executeOperations
* @param Transaction $transaction
*/
public function __construct($eventName, Composer $composer, IOInterface $io, $devMode, $executeOperations, Transaction $transaction)
{

@ -82,9 +82,8 @@ interface InstallerInterface
* @param InstalledRepositoryInterface $repo repository in which to check
* @param PackageInterface $initial already installed package version
* @param PackageInterface $target updated version
* @throws InvalidArgumentException if $initial package is not installed
* @return PromiseInterface|null
*
* @throws InvalidArgumentException if $initial package is not installed
*/
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target);

@ -139,6 +139,7 @@ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface
$binaryInstaller = $this->binaryInstaller;
$installPath = $this->getInstallPath($package);
return $promise->then(function () use ($binaryInstaller, $installPath, $package, $repo) {
$binaryInstaller->installBinaries($package, $installPath);
if (!$repo->hasPackage($package)) {
@ -166,6 +167,7 @@ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface
$binaryInstaller = $this->binaryInstaller;
$installPath = $this->getInstallPath($target);
return $promise->then(function () use ($binaryInstaller, $installPath, $target, $initial, $repo) {
$binaryInstaller->installBinaries($target, $installPath);
$repo->removePackage($initial);
@ -192,6 +194,7 @@ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface
$binaryInstaller = $this->binaryInstaller;
$downloadPath = $this->getPackageBasePath($package);
$filesystem = $this->filesystem;
return $promise->then(function () use ($binaryInstaller, $filesystem, $downloadPath, $package, $repo) {
$binaryInstaller->removeBinaries($package);
$repo->removePackage($package);
@ -252,6 +255,7 @@ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface
protected function installCode(PackageInterface $package)
{
$downloadPath = $this->getInstallPath($package);
return $this->downloadManager->install($package, $downloadPath);
}
@ -271,6 +275,7 @@ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface
}
$self = $this;
return $promise->then(function () use ($self, $target) {
$reflMethod = new \ReflectionMethod($self, 'installCode');
$reflMethod->setAccessible(true);
@ -283,12 +288,14 @@ class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface
$this->filesystem->rename($initialDownloadPath, $targetDownloadPath);
}
return $this->downloadManager->update($initial, $target, $targetDownloadPath);
}
protected function removeCode(PackageInterface $package)
{
$downloadPath = $this->getPackageBasePath($package);
return $this->downloadManager->remove($package, $downloadPath);
}

@ -14,7 +14,6 @@ namespace Composer\Installer;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Package\PackageInterface;
use Composer\Package\Version\VersionParser;
use Composer\IO\IOInterface;
use Composer\DependencyResolver\Operation\UpdateOperation;
use Composer\DependencyResolver\Operation\InstallOperation;

@ -15,10 +15,7 @@ namespace Composer\Installer;
use Composer\Composer;
use Composer\IO\IOInterface;
use Composer\DependencyResolver\Operation\OperationInterface;
use Composer\DependencyResolver\PolicyInterface;
use Composer\DependencyResolver\Request;
use Composer\Repository\RepositoryInterface;
use Composer\Repository\RepositorySet;
use Composer\EventDispatcher\Event;
/**

@ -71,6 +71,7 @@ class PluginInstaller extends LibraryInstaller
$pluginManager = $this->composer->getPluginManager();
$self = $this;
return $promise->then(function () use ($self, $pluginManager, $package, $repo) {
try {
$pluginManager->registerPackage($package, true);
@ -92,6 +93,7 @@ class PluginInstaller extends LibraryInstaller
$pluginManager = $this->composer->getPluginManager();
$self = $this;
return $promise->then(function () use ($self, $pluginManager, $initial, $target, $repo) {
try {
$pluginManager->deactivatePackage($initial, true);

@ -182,8 +182,8 @@ class SuggestedPackagesReporter
}
/**
* @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped
* @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown
* @param InstalledRepository|null $installedRepo If passed in, suggested packages which are installed already will be skipped
* @param PackageInterface|null $onlyDependentsOf If passed in, only the suggestions from direct dependents of that package, or from the package itself, will be shown
* @return array[]
*/
private function getFilteredSuggestions(InstalledRepository $installedRepo = null, PackageInterface $onlyDependentsOf = null)

@ -164,7 +164,7 @@ class JsonFile
/**
* 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
* @param string|null $schemaFile a path to the schema file
* @throws JsonValidationException
* @return bool true on success

@ -431,7 +431,7 @@ class AliasPackage extends BasePackage implements CompletePackageInterface
public function __toString()
{
return parent::__toString().' ('.($this->rootPackageAlias ? 'root ':''). 'alias of '.$this->aliasOf->getVersion().')';
return parent::__toString().' ('.($this->rootPackageAlias ? 'root ' : ''). 'alias of '.$this->aliasOf->getVersion().')';
}
public function setDistUrl($url)

@ -258,7 +258,7 @@ abstract class BasePackage implements PackageInterface
* Build a regexp from a package name, expanding * globs as required
*
* @param string $allowPattern
* @param string $wrap Wrap the cleaned string by the given string
* @param string $wrap Wrap the cleaned string by the given string
* @return string
*/
public static function packageNameToRegexp($allowPattern, $wrap = '{^%s$}i')

@ -70,12 +70,12 @@ class Link
/**
* Creates a new package link.
*
* @param string $source
* @param string $target
* @param ConstraintInterface $constraint Constraint applying to the target of this link
* @param string $description Used to create a descriptive string representation
* @param string $source
* @param string $target
* @param ConstraintInterface $constraint Constraint applying to the target of this link
* @param string $description Used to create a descriptive string representation
* @phpstan-param self::TYPE_* $description
* @param string|null $prettyConstraint
* @param string|null $prettyConstraint
*/
public function __construct(
$source,

@ -295,11 +295,11 @@ class ArrayLoader implements LoaderInterface
}
/**
* @param string $source source package name
* @param string $sourceVersion source package version (pretty version ideally)
* @param string $description link description (e.g. requires, replaces, ..)
* @param string $source source package name
* @param string $sourceVersion source package version (pretty version ideally)
* @param string $description link description (e.g. requires, replaces, ..)
* @phpstan-param Link::TYPE_* $description
* @param array $links array of package name => constraint mappings
* @param array $links array of package name => constraint mappings
* @return Link[]
*/
public function parseLinks($source, $sourceVersion, $description, $links)

@ -15,7 +15,6 @@ namespace Composer\Package;
use Composer\Json\JsonFile;
use Composer\Installer\InstallationManager;
use Composer\Repository\LockArrayRepository;
use Composer\Repository\RepositoryManager;
use Composer\Util\ProcessExecutor;
use Composer\Package\Dumper\ArrayDumper;
use Composer\Package\Loader\ArrayLoader;
@ -334,6 +333,7 @@ class Locker
if (in_array($alias['version'], array('dev-master', 'dev-trunk', 'dev-default'), true)) {
$alias['version'] = VersionParser::DEFAULT_BRANCH_ALIAS;
}
return $alias;
}, $aliases);

@ -203,7 +203,7 @@ interface PackageInterface
*
* @see getPrettyVersion
*
* @param bool $truncate If the source reference is a sha1 hash, truncate it
* @param bool $truncate If the source reference is a sha1 hash, truncate it
* @param int $displayMode One of the DISPLAY_ constants on this interface determining display of references
* @return string version
*

@ -26,9 +26,9 @@ class StabilityFilter
* @psalm-param array<string, BasePackage::STABILITY_*> $acceptableStabilities
* @param int[] $stabilityFlags an array of package name => BasePackage::STABILITY_* value
* @psalm-param array<string, BasePackage::STABILITY_*> $stabilityFlags
* @param string[] $names The package name(s) to check for stability flags
* @param string $stability one of 'stable', 'RC', 'beta', 'alpha' or 'dev'
* @return bool true if any package name is acceptable
* @param string[] $names The package name(s) to check for stability flags
* @param string $stability one of 'stable', 'RC', 'beta', 'alpha' or 'dev'
* @return bool true if any package name is acceptable
*/
public static function isPackageAcceptable(array $acceptableStabilities, array $stabilityFlags, $names, $stability)
{

@ -21,7 +21,6 @@ use Composer\Util\HttpDownloader;
use Composer\Util\ProcessExecutor;
use Composer\Util\Svn as SvnUtil;
/**
* Try to guess the current version number based on different VCS configuration.
*

@ -12,10 +12,8 @@
namespace Composer\Package\Version;
use Composer\DependencyResolver\Pool;
use Composer\Package\BasePackage;
use Composer\Package\PackageInterface;
use Composer\Plugin\PluginInterface;
use Composer\Composer;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Dumper\ArrayDumper;
@ -54,10 +52,10 @@ class VersionSelector
* Given a package name and optional version, returns the latest PackageInterface
* that matches.
*
* @param string $packageName
* @param string $targetPackageVersion
* @param string $preferredStability
* @param bool|array $ignorePlatformReqs
* @param string $packageName
* @param string $targetPackageVersion
* @param string $preferredStability
* @param bool|array $ignorePlatformReqs
* @return PackageInterface|false
*/
public function findBestCandidate($packageName, $targetPackageVersion = null, $preferredStability = 'stable', $ignorePlatformReqs = false, $repoSetFlags = 0)

@ -1,4 +1,5 @@
<?php
/*
* This file is part of Composer.
*

@ -15,8 +15,8 @@ namespace Composer\Platform;
class Runtime
{
/**
* @param string $constant
* @param class-string $class
* @param string $constant
* @param class-string $class
* @return bool
*/
public function hasConstant($constant, $class = null)
@ -25,8 +25,8 @@ class Runtime
}
/**
* @param bool $constant
* @param class-string $class
* @param bool $constant
* @param class-string $class
* @return mixed
*/
public function getConstant($constant, $class = null)
@ -35,7 +35,7 @@ class Runtime
}
/**
* @param string $fn
* @param string $fn
* @return bool
*/
public function hasFunction($fn)
@ -44,8 +44,8 @@ class Runtime
}
/**
* @param callable $callable
* @param array $arguments
* @param callable $callable
* @param array $arguments
* @return mixed
*/
public function invoke($callable, array $arguments = array())
@ -54,7 +54,7 @@ class Runtime
}
/**
* @param class-string $class
* @param class-string $class
* @return bool
*/
public function hasClass($class)
@ -63,8 +63,8 @@ class Runtime
}
/**
* @param class-string $class
* @param array $arguments
* @param class-string $class
* @param array $arguments
* @return object
*/
public function construct($class, array $arguments = array())
@ -74,6 +74,7 @@ class Runtime
}
$refl = new \ReflectionClass($class);
return $refl->newInstanceArgs($arguments);
}
@ -84,7 +85,7 @@ class Runtime
}
/**
* @param string $extension
* @param string $extension
* @return string
*/
public function getExtensionVersion($extension)
@ -93,7 +94,7 @@ class Runtime
}
/**
* @param string $extension
* @param string $extension
* @return string
*/
public function getExtensionInfo($extension)

@ -18,8 +18,8 @@ namespace Composer\Platform;
class Version
{
/**
* @param string $opensslVersion
* @param bool $isFips
* @param string $opensslVersion
* @param bool $isFips
* @return string|null
*/
public static function parseOpenssl($opensslVersion, &$isFips)
@ -38,7 +38,7 @@ class Version
}
/**
* @param string $libjpegVersion
* @param string $libjpegVersion
* @return string|null
*/
public static function parseLibjpeg($libjpegVersion)
@ -51,7 +51,7 @@ class Version
}
/**
* @param string $zoneinfoVersion
* @param string $zoneinfoVersion
* @return string|null
*/
public static function parseZoneinfoVersion($zoneinfoVersion)
@ -66,16 +66,16 @@ class Version
/**
* "" => 0, "a" => 1, "zg" => 33
*
* @param string $alpha
* @param string $alpha
* @return int
*/
private static function convertAlphaVersionToIntVersion($alpha)
{
return strlen($alpha) * (-ord('a')+1) + array_sum(array_map('ord', str_split($alpha)));
return strlen($alpha) * (-ord('a') + 1) + array_sum(array_map('ord', str_split($alpha)));
}
/**
* @param int $versionId
* @param int $versionId
* @return string
*/
public static function convertLibxpmVersionId($versionId)
@ -84,7 +84,7 @@ class Version
}
/**
* @param int $versionId
* @param int $versionId
* @return string
*/
public static function convertOpenldapVersionId($versionId)

@ -22,7 +22,6 @@ use Composer\Package\PackageInterface;
*/
class PostFileDownloadEvent extends Event
{
/**
* @var string
*/
@ -46,11 +45,11 @@ class PostFileDownloadEvent extends Event
/**
* Constructor.
*
* @param string $name The event name
* @param string $fileName The file name
* @param string|null $checksum The checksum
* @param string $url The processed url
* @param PackageInterface $package The package.
* @param string $name The event name
* @param string $fileName The file name
* @param string|null $checksum The checksum
* @param string $url The processed url
* @param PackageInterface $package The package.
*/
public function __construct($name, $fileName, $checksum, $url, PackageInterface $package)
{
@ -76,7 +75,8 @@ class PostFileDownloadEvent extends Event
*
* @return string|null
*/
public function getChecksum() {
public function getChecksum()
{
return $this->checksum;
}
@ -85,18 +85,18 @@ class PostFileDownloadEvent extends Event
*
* @return string
*/
public function getUrl() {
public function getUrl()
{
return $this->url;
}
/**
* Get the package.
*
* @return \Composer\Package\PackageInterface
* The package.
* @return \Composer\Package\PackageInterface The package.
*/
public function getPackage() {
public function getPackage()
{
return $this->package;
}
}

@ -50,11 +50,11 @@ class PreFileDownloadEvent extends Event
/**
* Constructor.
*
* @param string $name The event name
* @param HttpDownloader $httpDownloader
* @param string $processedUrl
* @param string $type
* @param mixed $context
* @param string $name The event name
* @param HttpDownloader $httpDownloader
* @param string $processedUrl
* @param string $type
* @param mixed $context
*/
public function __construct($name, HttpDownloader $httpDownloader, $processedUrl, $type, $context = null)
{

@ -13,7 +13,6 @@
namespace Composer\Plugin;
use Composer\EventDispatcher\Event;
use Symfony\Component\Console\Input\InputInterface;
use Composer\Repository\RepositoryInterface;
use Composer\DependencyResolver\Request;
use Composer\Package\PackageInterface;

@ -31,8 +31,8 @@ class ArrayRepository implements RepositoryInterface
protected $packages;
/**
* @var PackageInterface[] indexed by package unique name and used to cache hasPackage calls
*/
* @var PackageInterface[] indexed by package unique name and used to cache hasPackage calls
*/
protected $packageMap;
public function __construct(array $packages = array())

@ -94,7 +94,7 @@ class ArtifactRepository extends ArrayRepository implements ConfigurableReposito
$fileExtension = pathinfo($file->getPathname(), PATHINFO_EXTENSION);
if (in_array($fileExtension, array('gz', 'tar', 'tgz'), true)) {
$fileType = 'tar';
} else if ($fileExtension === 'zip') {
} elseif ($fileExtension === 'zip') {
$fileType = 'zip';
} else {
throw new \RuntimeException('Files with "'.$fileExtension.'" extensions aren\'t supported. Only ZIP and TAR/TAR.GZ/TGZ archives are supported.');

@ -76,7 +76,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
* TODO v3 should make this private once we can drop PHP 5.3 support
* @private
* @var array list of package names which are fresh and can be loaded from the cache directly in case loadPackage is called several times
* useful for v2 metadata repositories with lazy providers
* useful for v2 metadata repositories with lazy providers
*/
public $freshMetadataUrls = array();
@ -84,7 +84,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
* TODO v3 should make this private once we can drop PHP 5.3 support
* @private
* @var array list of package names which returned a 404 and should not be re-fetched in case loadPackage is called several times
* useful for v2 metadata repositories with lazy providers
* useful for v2 metadata repositories with lazy providers
*/
public $packagesNotFoundCache = array();
/**
@ -527,7 +527,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
}
/**
* @param string $name package name
* @param string $name package name
* @return array|mixed
*/
private function whatProvides($name, array $acceptableStabilities = null, array $stabilityFlags = null, array $alreadyLoaded = array())
@ -1244,19 +1244,21 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
$io = $this->io;
$url = $this->url;
$cache = $this->cache;
$degradedMode =& $this->degradedMode;
$degradedMode = &$this->degradedMode;
$repo = $this;
$accept = function ($response) use ($io, $url, $filename, $cache, $cacheKey, $repo) {
// package not found is acceptable for a v2 protocol repository
if ($response->getStatusCode() === 404) {
$repo->packagesNotFoundCache[$filename] = true;
return array('packages' => array());
}
$json = $response->getBody();
if ($json === '' && $response->getStatusCode() === 304) {
$repo->freshMetadataUrls[$filename] = true;
return true;
}
@ -1280,6 +1282,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
$reject = function ($e) use (&$retries, $httpDownloader, $filename, $options, &$reject, $accept, $io, $url, &$degradedMode, $repo) {
if ($e instanceof TransportException && $e->getStatusCode() === 404) {
$repo->packagesNotFoundCache[$filename] = true;
return false;
}
@ -1333,8 +1336,8 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
/**
* Checks if the package name is present in this lazy providers repo
*
* @param string $name
* @return bool true if the package name is present in availablePackages or matched by availablePackagePatterns
* @param string $name
* @return bool true if the package name is present in availablePackages or matched by availablePackagePatterns
*/
protected function lazyProvidersRepoContains($name)
{

@ -41,7 +41,9 @@ class CompositeRepository implements RepositoryInterface
public function getRepoName()
{
return 'composite repo ('.implode(', ', array_map(function ($repo) { return $repo->getRepoName(); }, $this->repositories)).')';
return 'composite repo ('.implode(', ', array_map(function ($repo) {
return $repo->getRepoName();
}, $this->repositories)).')';
}
/**

@ -35,9 +35,9 @@ class FilesystemRepository extends WritableArrayRepository
/**
* Initializes filesystem repository.
*
* @param JsonFile $repositoryFile repository json file
* @param bool $dumpVersions
* @param ?RootPackageInterface $rootPackage Must be provided if $dumpVersions is true
* @param JsonFile $repositoryFile repository json file
* @param bool $dumpVersions
* @param ?RootPackageInterface $rootPackage Must be provided if $dumpVersions is true
*/
public function __construct(JsonFile $repositoryFile, $dumpVersions = false, RootPackageInterface $rootPackage = null)
{

@ -16,11 +16,9 @@ use Composer\Package\Version\VersionParser;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\Constraint;
use Composer\Semver\Constraint\MatchAllConstraint;
use Composer\Package\AliasPackage;
use Composer\Package\RootPackageInterface;
use Composer\Package\Link;
/**
* Installed repository is a composite of all installed repo types.
*
@ -231,7 +229,9 @@ class InstalledRepository extends CompositeRepository
public function getRepoName()
{
return 'installed repo ('.implode(', ', array_map(function ($repo) { return $repo->getRepoName(); }, $this->getRepositories())).')';
return 'installed repo ('.implode(', ', array_map(function ($repo) {
return $repo->getRepoName();
}, $this->getRepositories())).')';
}
/**

@ -26,4 +26,3 @@ class LockArrayRepository extends ArrayRepository
return 'lock repo';
}
}

@ -12,17 +12,6 @@
namespace Composer\Repository;
use Composer\IO\IOInterface;
use Composer\Semver\VersionParser as SemverVersionParser;
use Composer\Package\Version\VersionParser;
use Composer\Package\CompletePackage;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Package\Link;
use Composer\Semver\Constraint\Constraint;
use Composer\Util\HttpDownloader;
use Composer\Config;
use Composer\Factory;
/**
* Builds list of package from PEAR channel.
*

@ -186,7 +186,7 @@ class PlatformRepository extends ArrayRepository
$library = strtolower($sslMatches['library']);
if ($library === 'openssl') {
$parsedVersion = Version::parseOpenssl($sslMatches['version'], $isFips);
$this->addLibrary($name.'-openssl'.($isFips ? '-fips': ''), $parsedVersion, 'curl OpenSSL version ('.$parsedVersion.')', array(), $isFips ? array('curl-openssl'): array());
$this->addLibrary($name.'-openssl'.($isFips ? '-fips' : ''), $parsedVersion, 'curl OpenSSL version ('.$parsedVersion.')', array(), $isFips ? array('curl-openssl') : array());
} else {
$this->addLibrary($name.'-'.$library, $sslMatches['version'], 'curl '.$library.' version ('.$sslMatches['version'].')', array('curl-openssl'));
}
@ -315,7 +315,7 @@ class PlatformRepository extends ArrayRepository
case 'libxml':
// ext/dom, ext/simplexml, ext/xmlreader and ext/xmlwriter use the same libxml as the ext/libxml
$libxmlProvides = array_map(function($extension) {
$libxmlProvides = array_map(function ($extension) {
return $extension . '-libxml';
}, array_intersect($loadedExtensions, array('dom', 'simplexml', 'xml', 'xmlreader', 'xmlwriter')));
$this->addLibrary($name, $this->runtime->getConstant('LIBXML_DOTTED_VERSION'), 'libxml library version', array(), $libxmlProvides);
@ -441,7 +441,7 @@ class PlatformRepository extends ArrayRepository
case 'zip':
if ($this->runtime->hasConstant('LIBZIP_VERSION', 'ZipArchive')) {
$this->addLibrary($name.'-libzip', $this->runtime->getConstant('LIBZIP_VERSION','ZipArchive'), null, array('zip'));
$this->addLibrary($name.'-libzip', $this->runtime->getConstant('LIBZIP_VERSION', 'ZipArchive'), null, array('zip'));
}
break;
@ -549,7 +549,7 @@ class PlatformRepository extends ArrayRepository
if ($name === 'uuid') {
$ext->setReplaces(array(
new Link('ext-uuid', 'lib-uuid', new Constraint('=', $version), Link::TYPE_REPLACE, $ext->getPrettyVersion())
new Link('ext-uuid', 'lib-uuid', new Constraint('=', $version), Link::TYPE_REPLACE, $ext->getPrettyVersion()),
));
}
@ -557,7 +557,7 @@ class PlatformRepository extends ArrayRepository
}
/**
* @param string $name
* @param string $name
* @return string
*/
private function buildPackageName($name)
@ -599,7 +599,7 @@ class PlatformRepository extends ArrayRepository
/**
* Check if a package name is a platform package.
*
* @param string $name
* @param string $name
* @return bool
*/
public static function isPlatformPackage($name)

@ -70,8 +70,8 @@ interface RepositoryInterface extends \Countable
* - The packages returned are the packages found which match the constraints, acceptable stability and stability flags provided
* - The namesFound returned are names which should be considered as canonically found in this repository, that should not be looked up in any further lower priority repositories
*
* @param ConstraintInterface[] $packageNameMap package names pointing to constraints
* @param int[] $acceptableStabilities array of stability => BasePackage::STABILITY_* value
* @param ConstraintInterface[] $packageNameMap package names pointing to constraints
* @param int[] $acceptableStabilities array of stability => BasePackage::STABILITY_* value
* @psalm-param array<string, BasePackage::STABILITY_*> $acceptableStabilities
* @param int[] $stabilityFlags an array of package name => BasePackage::STABILITY_* value
* @psalm-param array<string, BasePackage::STABILITY_*> $stabilityFlags

@ -20,12 +20,6 @@ use Composer\IO\IOInterface;
use Composer\IO\NullIO;
use Composer\Package\BasePackage;
use Composer\Package\AliasPackage;
use Composer\Package\Version\VersionParser;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\LockArrayRepository;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\Repository\InstalledRepository;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Package\Version\StabilityFilter;
@ -83,7 +77,7 @@ class RepositorySet
* aliases, pinned references and other special cases.
*
* @param string $minimumStability
* @param int[] $stabilityFlags an array of package name => BasePackage::STABILITY_* value
* @param int[] $stabilityFlags an array of package name => BasePackage::STABILITY_* value
* @psalm-param array<string, int> $stabilityFlags
* @param array[] $rootAliases
* @psalm-param list<array{package: string, version: string, alias: string, alias_normalized: string}> $rootAliases
@ -126,7 +120,7 @@ class RepositorySet
* The first repos added have a higher priority. As soon as a package is found in any
* repository the search for that package ends, and following repos will not be consulted.
*
* @param RepositoryInterface $repo A package repository
* @param RepositoryInterface $repo A package repository
*/
public function addRepository(RepositoryInterface $repo)
{
@ -150,9 +144,9 @@ class RepositorySet
*
* Returned in the order of repositories, matching priority
*
* @param string $name
* @param ConstraintInterface|null $constraint
* @param int $flags any of the ALLOW_* constants from this class to tweak what is returned
* @param string $name
* @param ConstraintInterface|null $constraint
* @param int $flags any of the ALLOW_* constants from this class to tweak what is returned
* @return array
*/
public function findPackages($name, ConstraintInterface $constraint = null, $flags = 0)
@ -262,7 +256,6 @@ class RepositorySet
$aliasPackage->setRootPackageAlias(true);
$packages[] = $aliasPackage;
}
}
}

@ -144,7 +144,7 @@ abstract class BitbucketDriver extends VcsDriver
$hash = $branches[$label];
}
if (! isset($hash)) {
if (!isset($hash)) {
$composer['support']['source'] = sprintf(
'https://%s/%s/%s/src',
$this->originUrl,

@ -165,7 +165,7 @@ class FossilDriver extends VcsDriver
public function getChangeDate($identifier)
{
$this->process->execute('fossil finfo -b -n 1 composer.json', $output, $this->checkoutDir);
list(,$date) = explode(' ', trim($output), 3);
list(, $date) = explode(' ', trim($output), 3);
return new \DateTime($date, new \DateTimeZone('UTC'));
}

@ -30,7 +30,7 @@ class GitBitbucketDriver extends BitbucketDriver
}
if (null === $this->rootIdentifier) {
if (! $this->getRepoData()) {
if (!$this->getRepoData()) {
return $this->fallbackDriver->getRootIdentifier();
}

@ -58,7 +58,7 @@ class GitHubDriver extends VcsDriver
$this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->owner.'/'.$this->repository);
$this->cache->setReadOnly($this->config->get('cache-read-only'));
if ( $this->config->get('use-github-api') === false || (isset($this->repoConfig['no-api']) && $this->repoConfig['no-api'] ) ){
if ($this->config->get('use-github-api') === false || (isset($this->repoConfig['no-api']) && $this->repoConfig['no-api'])) {
$this->setupGitDriver($this->url);
return;
@ -150,7 +150,7 @@ class GitHubDriver extends VcsDriver
if (!isset($this->infoCache[$identifier])) {
if ($this->shouldCache($identifier) && $res = $this->cache->read($identifier)) {
$composer = JsonFile::parseJson($res);
$composer = JsonFile::parseJson($res);
} else {
$composer = $this->getBaseComposerInformation($identifier);
@ -193,7 +193,6 @@ class GitHubDriver extends VcsDriver
}
foreach (array($this->getApiUrl() . '/repos/'.$this->owner.'/'.$this->repository.'/contents/.github/FUNDING.yml', $this->getApiUrl() . '/repos/'.$this->owner.'/.github/contents/FUNDING.yml') as $file) {
try {
$response = $this->httpDownloader->get($file, array(
'retry-auth-failure' => false,

@ -132,7 +132,7 @@ class GitLabDriver extends VcsDriver
if (!isset($this->infoCache[$identifier])) {
if ($this->shouldCache($identifier) && $res = $this->cache->read($identifier)) {
$composer = JsonFile::parseJson($res);
$composer = JsonFile::parseJson($res);
} else {
$composer = $this->getBaseComposerInformation($identifier);
@ -563,6 +563,7 @@ class GitLabDriver extends VcsDriver
if ($portNumber) {
return $guessedDomain.':'.$portNumber;
}
return $guessedDomain;
}

@ -30,7 +30,7 @@ class HgBitbucketDriver extends BitbucketDriver
}
if (null === $this->rootIdentifier) {
if (! $this->getRepoData()) {
if (!$this->getRepoData()) {
return $this->fallbackDriver->getRootIdentifier();
}

@ -15,7 +15,6 @@ namespace Composer\Repository\Vcs;
use Composer\Cache;
use Composer\Downloader\TransportException;
use Composer\Config;
use Composer\Factory;
use Composer\IO\IOInterface;
use Composer\Json\JsonFile;
use Composer\Util\ProcessExecutor;
@ -52,11 +51,11 @@ abstract class VcsDriver implements VcsDriverInterface
/**
* Constructor.
*
* @param array $repoConfig The repository configuration
* @param IOInterface $io The IO instance
* @param Config $config The composer configuration
* @param HttpDownloader $httpDownloader Remote Filesystem, injectable for mocking
* @param ProcessExecutor $process Process instance, injectable for mocking
* @param array $repoConfig The repository configuration
* @param IOInterface $io The IO instance
* @param Config $config The composer configuration
* @param HttpDownloader $httpDownloader Remote Filesystem, injectable for mocking
* @param ProcessExecutor $process Process instance, injectable for mocking
*/
final public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, ProcessExecutor $process)
{

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save