Total Complexity | 6 |
Total Lines | 46 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class ContainsObjectWithAttributeRule implements Rule |
||
9 | { |
||
10 | |||
11 | protected $attributeName; |
||
12 | protected $attributeValue; |
||
13 | |||
14 | /** |
||
15 | * Create a new rule instance. |
||
16 | * |
||
17 | * @param string $attributeName |
||
18 | * @param mixed $attributeValue |
||
19 | * @return void |
||
20 | */ |
||
21 | public function __construct($attributeName, $attributeValue) |
||
25 | } |
||
26 | |||
27 | protected function arrayAny(array $array, callable $fn) |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * This check passes if the $value is an array which contains an object |
||
39 | * with a attributeName relation equal to attributeValue |
||
40 | * @param mixed $attribute |
||
41 | * @param mixed $value |
||
42 | * @return boolean |
||
43 | */ |
||
44 | public function passes($attribute, $value) |
||
48 | }); |
||
49 | } |
||
50 | |||
51 | public function message() |
||
56 |