| 1 | <?php |
||
| 8 | class HigherOrderCollectionProxy |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The collection being operated on. |
||
| 12 | * |
||
| 13 | * @var \IlluminateAgnostic\Str\Support\Collection |
||
| 14 | */ |
||
| 15 | protected $collection; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The method being proxied. |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | protected $method; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Create a new proxy instance. |
||
| 26 | * |
||
| 27 | * @param \IlluminateAgnostic\Str\Support\Collection $collection |
||
| 28 | * @param string $method |
||
| 29 | * @return void |
||
|
|
|||
| 30 | */ |
||
| 31 | 5 | public function __construct(Collection $collection, $method) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Proxy accessing an attribute onto the collection items. |
||
| 39 | * |
||
| 40 | * @param string $key |
||
| 41 | * @return mixed |
||
| 42 | */ |
||
| 43 | public function __get($key) |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Proxy a method call onto the collection items. |
||
| 52 | * |
||
| 53 | * @param string $method |
||
| 54 | * @param array $parameters |
||
| 55 | * @return mixed |
||
| 56 | */ |
||
| 57 | public function __call($method, $parameters) |
||
| 63 | } |
||
| 64 |
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.