| 1 | <?php |
||
| 18 | class ImmutableCollection extends Collection |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @param mixed[] $items |
||
| 22 | */ |
||
| 23 | 16 | public function __construct(array $items = []) |
|
| 31 | |||
| 32 | /** |
||
| 33 | * @param mixed $value |
||
| 34 | * |
||
| 35 | * @return ImmutableCollection |
||
| 36 | */ |
||
| 37 | 2 | public function add($value) |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @param callable $fn |
||
| 47 | * |
||
| 48 | * @return ImmutableCollection |
||
| 49 | */ |
||
| 50 | 1 | public function filter(callable $fn) |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @param callable $fn |
||
| 57 | * |
||
| 58 | * @return ImmutableCollection |
||
| 59 | */ |
||
| 60 | 1 | public function sort(callable $fn) |
|
| 67 | |||
| 68 | /** |
||
| 69 | * @param callable $fn |
||
| 70 | * @param int $order |
||
| 71 | * |
||
| 72 | * @return ImmutableCollection |
||
| 73 | */ |
||
| 74 | 2 | public function sortOn(callable $fn, $order = Sort\ASC) |
|
| 78 | |||
| 79 | /** |
||
| 80 | * @param mixed $value |
||
| 81 | */ |
||
| 82 | 14 | protected function addItem($value) |
|
| 86 | } |
||
| 87 |
This check looks for a call to a parent method whose name is different than the method from which it is called.
Consider the following code:
The
getFirstName()method in theSoncalls the wrong method in the parent class.