| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class ContainsArrayWithAttributeRule 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) |
||
| 22 | { |
||
| 23 | $this->attributeName = $attributeName; |
||
| 24 | $this->attributeValue = $attributeValue; |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * This check passes if the $value is an array which contains an |
||
| 29 | * attributeName relation equal to attributeValue. |
||
| 30 | * @param mixed $attribute |
||
| 31 | * @param mixed $value |
||
| 32 | * @return boolean |
||
| 33 | */ |
||
| 34 | public function passes($attribute, $value) |
||
| 37 | } |
||
| 38 | |||
| 39 | public function message() |
||
| 46 | ] |
||
| 47 | ); |
||
| 50 |