Skip to content

Commit 7a70b43

Browse files
committed
move PublicCallbackDeclarator to this repo
1 parent 9f34e50 commit 7a70b43

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

src/AbstractHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace ApacheBorys\Retry;
55

66
use ApacheBorys\Retry\Entity\Config;
7-
use ApacheBorys\Retry\HandlerExceptionDefiner\StandardHandlerExceptionDeclarator;
7+
use ApacheBorys\Retry\HandlerExceptionDeclarator\StandardHandlerExceptionDeclarator;
88
use ApacheBorys\Retry\Interfaces\HandlerExceptionDeclaratorInterface;
99

1010
abstract class AbstractHandler
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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 $callback */
11+
private $callback;
12+
13+
public function initHandler(callable $callback): void
14+
{
15+
$this->callback = $callback;
16+
}
17+
18+
public function getCallback(): callable
19+
{
20+
return $this->callback;
21+
}
22+
}

src/HandlerExceptionDefiner/StandardHandlerExceptionDeclarator.php renamed to src/HandlerExceptionDeclarator/StandardHandlerExceptionDeclarator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
declare(strict_types=1);
33

4-
namespace ApacheBorys\Retry\HandlerExceptionDefiner;
4+
namespace ApacheBorys\Retry\HandlerExceptionDeclarator;
55

66
use ApacheBorys\Retry\Interfaces\HandlerExceptionDeclaratorInterface;
77

0 commit comments

Comments
 (0)