1 | <?php |
||
13 | trait CollectionAssertTrait |
||
14 | { |
||
15 | /** |
||
16 | * Perform a length assertion. |
||
17 | * |
||
18 | * @param string|array|Countable $countable |
||
19 | * @param $length |
||
20 | * @param string $message |
||
21 | */ |
||
22 | public function lengthOf($countable, $length, $message = '') |
||
28 | |||
29 | /** |
||
30 | * Perform an inclusion assertion. |
||
31 | * |
||
32 | * @param array|string $haystack |
||
33 | * @param mixed $needle |
||
34 | * @param string $message |
||
35 | */ |
||
36 | public function isIncluded($haystack, $needle, $message = '') |
||
42 | |||
43 | /** |
||
44 | * Perform a negated inclusion assertion. |
||
45 | * |
||
46 | * @param array|string $haystack |
||
47 | * @param mixed $needle |
||
48 | * @param string $message |
||
49 | */ |
||
50 | public function notInclude($haystack, $needle, $message = '') |
||
56 | } |
||
57 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: