1 | <?php namespace Limoncello\Validation\Validator; |
||
33 | trait ExpressionsX |
||
34 | { |
||
35 | /** |
||
36 | * @param RuleInterface $first |
||
37 | * @param RuleInterface $second |
||
38 | * |
||
39 | * @return RuleInterface |
||
40 | */ |
||
41 | 5 | public static function andX(RuleInterface $first, RuleInterface $second) |
|
45 | |||
46 | /** |
||
47 | * @param RuleInterface $primary |
||
48 | * @param RuleInterface $secondary |
||
49 | * |
||
50 | * @return RuleInterface |
||
51 | */ |
||
52 | 4 | public static function orX(RuleInterface $primary, RuleInterface $secondary) |
|
56 | |||
57 | /** |
||
58 | * @param callable $condition |
||
59 | * @param RuleInterface $onTrue |
||
60 | * @param RuleInterface $onFalse |
||
61 | * |
||
62 | * @return RuleInterface |
||
63 | */ |
||
64 | 5 | public static function ifX( |
|
71 | |||
72 | /** |
||
73 | * @param RuleInterface[] $rules |
||
74 | * @param RuleInterface|null $unlisted |
||
75 | * |
||
76 | * @return RuleInterface |
||
77 | */ |
||
78 | 6 | public static function arrayX(array $rules, RuleInterface $unlisted = null) |
|
82 | |||
83 | /** |
||
84 | * @param RuleInterface $rule |
||
85 | * |
||
86 | * @return RuleInterface |
||
|
|||
87 | */ |
||
88 | 1 | public static function eachX(RuleInterface $rule) |
|
92 | |||
93 | /** |
||
94 | * @param RuleInterface[] $rules |
||
95 | * @param RuleInterface|null $unlisted |
||
96 | * |
||
97 | * @return RuleInterface |
||
98 | */ |
||
99 | 1 | public static function objectX(array $rules, RuleInterface $unlisted = null) |
|
103 | |||
104 | /** |
||
105 | * @param callable $callable |
||
106 | * @param int $messageCode |
||
107 | * |
||
108 | * @return RuleInterface |
||
109 | */ |
||
110 | 2 | public static function callableX(callable $callable, $messageCode = MessageCodes::INVALID_VALUE) |
|
114 | } |
||
115 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.