| 1 | <?php namespace Arcanedev\Support; |
||
| 11 | class Collection extends IlluminateCollection |
||
| 12 | { |
||
| 13 | /* ------------------------------------------------------------------------------------------------ |
||
| 14 | | Custom Functions |
||
| 15 | | ------------------------------------------------------------------------------------------------ |
||
| 16 | */ |
||
| 17 | /** |
||
| 18 | * Return only unique items from the collection array. |
||
| 19 | * |
||
| 20 | * @param string|callable|null $key |
||
| 21 | * @param bool $strict |
||
| 22 | 8 | * |
|
| 23 | * @return static |
||
| 24 | 8 | */ |
|
| 25 | public function unique($key = null, $strict = false) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Return only unique items from the collection array using strict comparison. |
||
| 43 | * |
||
| 44 | * @param string|callable|null $key |
||
| 45 | * |
||
| 46 | * @return static |
||
| 47 | */ |
||
| 48 | public function uniqueStrict($key = null) |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Reset the collection. |
||
| 55 | * |
||
| 56 | * @return static |
||
| 57 | */ |
||
| 58 | public function reset() |
||
| 64 | } |
||
| 65 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: