File tree Expand file tree Collapse file tree
HandlerExceptionDeclarator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44namespace ApacheBorys \Retry ;
55
66use ApacheBorys \Retry \Entity \Config ;
7- use ApacheBorys \Retry \HandlerExceptionDefiner \StandardHandlerExceptionDeclarator ;
7+ use ApacheBorys \Retry \HandlerExceptionDeclarator \StandardHandlerExceptionDeclarator ;
88use ApacheBorys \Retry \Interfaces \HandlerExceptionDeclaratorInterface ;
99
1010abstract class AbstractHandler
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ namespace ApacheBorys \Retry \HandlerExceptionDeclarator ;
5+
6+ use ApacheBorys \Retry \Interfaces \HandlerExceptionDeclaratorInterface ;
7+
8+ class PublicCallbackDeclarator implements HandlerExceptionDeclaratorInterface
9+ {
10+ /** @var callable|null $callback */
11+ private $ callback = null ;
12+
13+ public function initHandler (callable $ callback ): void
14+ {
15+ $ this ->callback = $ callback ;
16+ }
17+
18+ public function getCallback (): callable
19+ {
20+ if (is_null ($ this ->callback )) {
21+ throw new \LogicException ('Callback still not initialized. Please call `getCallback` method after `initHandler` ' );
22+ }
23+
24+ return $ this ->callback ;
25+ }
26+ }
Original file line number Diff line number Diff line change 11<?php
22declare (strict_types=1 );
33
4- namespace ApacheBorys \Retry \HandlerExceptionDefiner ;
4+ namespace ApacheBorys \Retry \HandlerExceptionDeclarator ;
55
66use ApacheBorys \Retry \Interfaces \HandlerExceptionDeclaratorInterface ;
77
You can’t perform that action at this time.
0 commit comments