1 | <?php |
||
12 | class CatchableCollectionProxy |
||
13 | { |
||
14 | /** |
||
15 | * The collection being operated on. |
||
16 | * |
||
17 | * @var \Illuminate\Collections\Enumerable |
||
18 | */ |
||
19 | protected $collection; |
||
20 | |||
21 | /** |
||
22 | * The collection methods to handle exceptions for. |
||
23 | * |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $calledMethods = []; |
||
27 | |||
28 | /** |
||
29 | * Create a new proxy instance. |
||
30 | * |
||
31 | * @param \Illuminate\Collections\Enumerable $collection |
||
32 | * @return void |
||
|
|||
33 | */ |
||
34 | public function __construct(Enumerable $collection) |
||
38 | |||
39 | /** |
||
40 | * Proxy a method call onto the collection items. |
||
41 | * |
||
42 | * @param string $method |
||
43 | * @param array $parameters |
||
44 | * @return $this |
||
45 | */ |
||
46 | public function __call($method, $parameters) |
||
52 | |||
53 | /** |
||
54 | * @param \Closure[] $handlers |
||
55 | * |
||
56 | * @return \Illuminate\Collections\Enumerable |
||
57 | */ |
||
58 | public function catch(...$handlers) |
||
79 | |||
80 | private function exceptionType($callable) |
||
90 | } |
||
91 |
Adding a
@return
annotation 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.