1 | <?php |
||
9 | trait SortingTrait |
||
10 | { |
||
11 | /** |
||
12 | * @return mixed |
||
13 | */ |
||
14 | public function end() |
||
19 | |||
20 | /** |
||
21 | * @return mixed |
||
22 | */ |
||
23 | public function current() |
||
27 | |||
28 | /** |
||
29 | * @return mixed |
||
30 | */ |
||
31 | public function next() |
||
36 | /** |
||
37 | * @return mixed |
||
38 | */ |
||
39 | public function rewind() |
||
45 | |||
46 | /** |
||
47 | * @return $this |
||
48 | */ |
||
49 | public function ksort() |
||
55 | |||
56 | /** |
||
57 | * @param $callback |
||
58 | * @return $this |
||
59 | */ |
||
60 | public function usort($callback) |
||
66 | |||
67 | /** |
||
68 | * @param $callback |
||
69 | * @return $this |
||
70 | */ |
||
71 | public function uasort($callback) |
||
77 | |||
78 | /** |
||
79 | * @return $this |
||
80 | */ |
||
81 | public function shuffle() |
||
87 | } |
||
88 |
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: