1 | <?php |
||
12 | trait CollectionAssertTrait |
||
13 | { |
||
14 | /** |
||
15 | * Perform a length assertion. |
||
16 | * |
||
17 | * @param string|array|Countable $countable |
||
18 | * @param $length |
||
19 | * @param string $message |
||
20 | */ |
||
21 | public function lengthOf($countable, $length, $message = "") |
||
26 | |||
27 | /** |
||
28 | * Perform an inclusion assertion. |
||
29 | * |
||
30 | * @param array|string $haystack |
||
31 | * @param mixed $needle |
||
32 | * @param string $message |
||
33 | */ |
||
34 | public function isIncluded($haystack, $needle, $message = "") |
||
39 | |||
40 | /** |
||
41 | * Perform a negated inclusion assertion. |
||
42 | * |
||
43 | * @param array|string $haystack |
||
44 | * @param mixed $needle |
||
45 | * @param string $message |
||
46 | */ |
||
47 | public function notInclude($haystack, $needle, $message = "") |
||
52 | } |
||
53 |
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: