1 | <?php declare(strict_types=1); |
||
39 | trait Generics |
||
40 | { |
||
41 | /** |
||
42 | * @param RuleInterface $first |
||
43 | * @param RuleInterface $second |
||
44 | * |
||
45 | * @return RuleInterface |
||
46 | */ |
||
47 | 1 | protected static function andX(RuleInterface $first, RuleInterface $second): RuleInterface |
|
51 | |||
52 | /** |
||
53 | * @param RuleInterface $primary |
||
54 | * @param RuleInterface $secondary |
||
55 | * |
||
56 | * @return RuleInterface |
||
57 | */ |
||
58 | 1 | protected static function orX(RuleInterface $primary, RuleInterface $secondary): RuleInterface |
|
62 | |||
63 | /** |
||
64 | * @param callable $condition |
||
65 | * @param RuleInterface $onTrue |
||
66 | * @param RuleInterface $onFalse |
||
67 | * @param array $settings |
||
68 | * |
||
69 | * @return RuleInterface |
||
70 | */ |
||
71 | 3 | protected static function ifX( |
|
79 | |||
80 | /** |
||
81 | * @return RuleInterface |
||
82 | */ |
||
83 | 10 | protected static function success(): RuleInterface |
|
87 | |||
88 | /** |
||
89 | * @param int $errorCode |
||
90 | * @param string $messageTemplate |
||
91 | * @param array $messageParams |
||
92 | * |
||
93 | * @return RuleInterface |
||
94 | */ |
||
95 | 3 | protected static function fail( |
|
102 | |||
103 | /** |
||
104 | * @param mixed $value |
||
105 | * |
||
106 | * @return RuleInterface |
||
107 | */ |
||
108 | 1 | protected static function value($value): RuleInterface |
|
115 | |||
116 | /** |
||
117 | * @param array $values |
||
118 | * @param RuleInterface|null $next |
||
119 | * |
||
120 | * @return RuleInterface |
||
121 | */ |
||
122 | 1 | protected static function enum(array $values, RuleInterface $next = null): RuleInterface |
|
126 | |||
127 | /** |
||
128 | * @param int $filterId |
||
129 | * @param mixed $options |
||
130 | * @param int $errorCode |
||
131 | * @param string $messageTemplate |
||
132 | * @param RuleInterface|null $next |
||
133 | * |
||
134 | * @return RuleInterface |
||
135 | */ |
||
136 | 1 | protected static function filter( |
|
147 | |||
148 | /** |
||
149 | * @param RuleInterface $rule |
||
|
|||
150 | * |
||
151 | * @return RuleInterface |
||
152 | */ |
||
153 | 1 | protected static function required(RuleInterface $rule = null): RuleInterface |
|
157 | } |
||
158 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.