From 75a8677e8a43e6f6bbf13923f2a1b98376becbb5 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 18 Oct 2021 23:05:31 +0200 Subject: [PATCH] Remove unknown Rule type --- src/Composer/DependencyResolver/Rule.php | 2 +- src/Composer/DependencyResolver/RuleSet.php | 6 ++---- src/Composer/DependencyResolver/RuleSetGenerator.php | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Composer/DependencyResolver/Rule.php b/src/Composer/DependencyResolver/Rule.php index 9dd6ccb48..bafd57994 100644 --- a/src/Composer/DependencyResolver/Rule.php +++ b/src/Composer/DependencyResolver/Rule.php @@ -125,7 +125,7 @@ abstract class Rule } /** - * @param 255|RuleSet::TYPE_* $type + * @param RuleSet::TYPE_* $type * @return void */ public function setType($type) diff --git a/src/Composer/DependencyResolver/RuleSet.php b/src/Composer/DependencyResolver/RuleSet.php index a34c76bb6..b754046a6 100644 --- a/src/Composer/DependencyResolver/RuleSet.php +++ b/src/Composer/DependencyResolver/RuleSet.php @@ -32,9 +32,8 @@ class RuleSet implements \IteratorAggregate, \Countable */ public $ruleById = array(); - /** @var array<255|0|1|4, string> */ + /** @var array<0|1|4, string> */ protected static $types = array( - 255 => 'UNKNOWN', self::TYPE_PACKAGE => 'PACKAGE', self::TYPE_REQUEST => 'REQUEST', self::TYPE_LEARNED => 'LEARNED', @@ -57,7 +56,7 @@ class RuleSet implements \IteratorAggregate, \Countable } /** - * @param 255|self::TYPE_* $type + * @param self::TYPE_* $type * @return void */ public function add(Rule $rule, $type) @@ -182,7 +181,6 @@ class RuleSet implements \IteratorAggregate, \Countable public function getTypes() { $types = self::$types; - unset($types[255]); return array_keys($types); } diff --git a/src/Composer/DependencyResolver/RuleSetGenerator.php b/src/Composer/DependencyResolver/RuleSetGenerator.php index d0e4554b5..e20a6299e 100644 --- a/src/Composer/DependencyResolver/RuleSetGenerator.php +++ b/src/Composer/DependencyResolver/RuleSetGenerator.php @@ -145,7 +145,7 @@ class RuleSetGenerator * To be able to directly pass in the result of one of the rule creation * methods null is allowed which will not insert a rule. * - * @param 255|RuleSet::TYPE_* $type A TYPE_* constant defining the rule type + * @param RuleSet::TYPE_* $type A TYPE_* constant defining the rule type * @param Rule $newRule The rule about to be added * * @return void