1 | <?php namespace Limoncello\Validation; |
||
29 | class ArrayValidator extends BaseValidator |
||
30 | { |
||
31 | use ArrayValidation; |
||
32 | |||
33 | /** |
||
34 | * @var ContainerInterface|null |
||
35 | */ |
||
36 | private $container; |
||
37 | |||
38 | /** |
||
39 | * @param RuleInterface[] $rules |
||
40 | * @param ContainerInterface|null $container |
||
41 | */ |
||
42 | 3 | public function __construct(array $rules, ContainerInterface $container = null) |
|
52 | |||
53 | /** |
||
54 | * @param RuleInterface[] $rules |
||
55 | * @param ContainerInterface $container |
||
|
|||
56 | * |
||
57 | * @return self |
||
58 | */ |
||
59 | 3 | public static function validator(array $rules = [], ContainerInterface $container = null): self |
|
65 | |||
66 | /** |
||
67 | * @inheritdoc |
||
68 | */ |
||
69 | 3 | public function validate($input): bool |
|
82 | |||
83 | /** |
||
84 | * @return ContainerInterface|null |
||
85 | */ |
||
86 | 3 | protected function getContainer(): ?ContainerInterface |
|
90 | |||
91 | /** |
||
92 | * During validation you can pass to rules your custom context which might have any additional |
||
93 | * resources needed by your rules (extra properties, database connection settings, container, and etc). |
||
94 | * |
||
95 | * @param array $blocks |
||
96 | * |
||
97 | * @return ContextStorageInterface |
||
98 | */ |
||
99 | 3 | protected function createContextStorageFromBlocks(array $blocks): ContextStorageInterface |
|
103 | } |
||
104 |
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.