@@ 92-99 (lines=8) @@ | ||
89 | * @return Evacuator|$this |
|
90 | * @throws \InvalidArgumentException |
|
91 | */ |
|
92 | public function catch(\Closure $then): Evacuator |
|
93 | { |
|
94 | $exceptionClass = $this->resolveTypeHint($then, \Throwable::class); |
|
95 | ||
96 | $this->catches[$exceptionClass] = $then; |
|
97 | ||
98 | return $this; |
|
99 | } |
|
100 | ||
101 | /** |
|
102 | * @param \Closure $then |
|
@@ 106-113 (lines=8) @@ | ||
103 | * @return Evacuator |
|
104 | * @throws \InvalidArgumentException |
|
105 | */ |
|
106 | public function onError(\Closure $then): Evacuator |
|
107 | { |
|
108 | $exceptionClass = $this->resolveTypeHint($then, \Throwable::class); |
|
109 | ||
110 | $this->everyError[$exceptionClass] = $then; |
|
111 | ||
112 | return $this; |
|
113 | } |
|
114 | ||
115 | /** |
|
116 | * @param \Closure $closure |