| 1 | <?php |
||
| 10 | trait MutableTrait |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * {@inheritdoc} |
||
| 14 | * |
||
| 15 | */ |
||
| 16 | public function remove($item) |
||
| 23 | |||
| 24 | |||
| 25 | /** |
||
| 26 | * {@inheritdoc} |
||
| 27 | * |
||
| 28 | */ |
||
| 29 | public function filter(callable $callable) |
||
| 36 | |||
| 37 | |||
| 38 | /** |
||
| 39 | * {@inheritdoc} |
||
| 40 | * |
||
| 41 | */ |
||
| 42 | public function map(callable $callable) |
||
| 49 | |||
| 50 | |||
| 51 | /** |
||
| 52 | * {@inheritdoc} |
||
| 53 | * |
||
| 54 | */ |
||
| 55 | public function diff(CollectionInterface ...$collection) |
||
| 62 | |||
| 63 | |||
| 64 | /** |
||
| 65 | * {@inheritdoc} |
||
| 66 | * |
||
| 67 | */ |
||
| 68 | public function intersect(CollectionInterface ...$collection) |
||
| 75 | } |
||
| 76 |
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: