1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Fixes from PHPStan level 0

More fixes from PHPStan level 0
This commit is contained in:
Gabriel Caruso 2018-01-06 12:05:39 -02:00
parent 994bac0c15
commit 3d262bd637
13 changed files with 18 additions and 12 deletions

View file

@ -34,7 +34,7 @@ use Symfony\Component\Console\Output\OutputInterface;
*/
class DiagnoseCommand extends BaseCommand
{
/** @var RemoteFileSystem */
/** @var RemoteFilesystem */
protected $rfs;
/** @var ProcessExecutor */

View file

@ -279,7 +279,7 @@ EOT
$minimumStability = $input->getOption('stability') ?: null;
$minimumStability = $io->askAndValidate(
'Minimum Stability [<comment>'.$minimumStability.'</comment>]: ',
function ($value) use ($self, $minimumStability) {
function ($value) use ($minimumStability) {
if (null === $value) {
return $minimumStability;
}

View file

@ -41,6 +41,7 @@ abstract class Rule
const BITFIELD_DISABLED = 16;
protected $bitfield;
protected $job;
protected $reasonData;
/**

View file

@ -30,7 +30,7 @@ class Solver
protected $pool;
/** @var RepositoryInterface */
protected $installed;
/** @var Ruleset */
/** @var RuleSet */
protected $rules;
/** @var RuleSetGenerator */
protected $ruleSetGenerator;

View file

@ -546,7 +546,7 @@ class Factory
$im->addInstaller(new Installer\LibraryInstaller($io, $composer, null));
$im->addInstaller(new Installer\PearInstaller($io, $composer, 'pear-library'));
$im->addInstaller(new Installer\PluginInstaller($io, $composer));
$im->addInstaller(new Installer\MetapackageInstaller($io));
$im->addInstaller(new Installer\MetapackageInstaller());
}
/**

View file

@ -32,9 +32,8 @@ class PluginInstaller extends LibraryInstaller
*
* @param IOInterface $io
* @param Composer $composer
* @param string $type
*/
public function __construct(IOInterface $io, Composer $composer, $type = 'library')
public function __construct(IOInterface $io, Composer $composer)
{
parent::__construct($io, $composer, 'composer-plugin');
$this->installationManager = $composer->getInstallationManager();

View file

@ -229,7 +229,7 @@ class JsonManipulator
// child exists
$childRegex = '{'.self::$DEFINES.'(?P<start>"'.preg_quote($name).'"\s*:\s*)(?P<content>(?&json))(?P<end>,?)}x';
if ($this->pregMatch($childRegex, $children, $matches)) {
$children = preg_replace_callback($childRegex, function ($matches) use ($name, $subName, $value, $that) {
$children = preg_replace_callback($childRegex, function ($matches) use ($subName, $value, $that) {
if ($subName !== null) {
$curVal = json_decode($matches['content'], true);
if (!is_array($curVal)) {

View file

@ -71,7 +71,7 @@ abstract class BaseExcludeFilter
* Processes a file containing exclude rules of different formats per line
*
* @param array $lines A set of lines to be parsed
* @param callback $lineParser The parser to be used on each line
* @param callable $lineParser The parser to be used on each line
*
* @return array Exclude patterns to be used in filter()
*/

View file

@ -68,7 +68,7 @@ interface RepositoryInterface extends \Countable
* @param string $query search query
* @param int $mode a set of SEARCH_* constants to search on, implementations should do a best effort only
*
* @return \array[] an array of array('name' => '...', 'description' => '...')
* @return array[] an array of array('name' => '...', 'description' => '...')
*/
public function search($query, $mode = 0);
}