1
0
Fork 0

Merge pull request #10185 from Seldaek/remove_unknown_rule_type

Remove unknown Rule type
pull/10206/head
Nils Adermann 2021-10-19 22:00:10 +02:00 committed by GitHub
commit cbc686c16a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

View File

@ -125,7 +125,7 @@ abstract class Rule
}
/**
* @param 255|RuleSet::TYPE_* $type
* @param RuleSet::TYPE_* $type
* @return void
*/
public function setType($type)

View File

@ -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);
}

View File

@ -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