Skip to content

Commit 080280a

Browse files
authored
Merge pull request #13 from apacheborys/introduce-factory
make initialisation in factory
2 parents f5ba2b0 + 5bc7d91 commit 080280a

5 files changed

Lines changed: 4 additions & 5 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ With this library you will be able to introduce re-try approach in simple way:
1111
```php
1212
$factory = new \ApacheBorys\Retry\HandlerFactory($config);
1313
$retry = $factory->createExceptionHandler($yourContainer);
14-
$retry->initHandler();
1514
```
1615
3. Start by another process code like that:
1716
```php

src/HandlerFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ public function __construct(array $config, LoggerInterface $logger = null)
3232

3333
public function createExceptionHandler(?ContainerInterface $container = null): ExceptionHandler
3434
{
35-
return new ExceptionHandler($this->compileConfig($container), $this->instantiateDeclarator($container), $this->logger);
35+
$handler = new ExceptionHandler($this->compileConfig($container), $this->instantiateDeclarator($container), $this->logger);
36+
$handler->initHandler();
37+
38+
return $handler;
3639
}
3740

3841
public function createMessageHandler(?ContainerInterface $container = null): MessageHandler

tests/Functional/FunctionalTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
use ApacheBorys\Retry\HandlerExceptionDeclarator\StandardHandlerExceptionDeclarator;
77
use ApacheBorys\Retry\HandlerFactory;
8-
use ApacheBorys\Retry\MessageHandler;
98
use ApacheBorys\Retry\Tests\Functional\Container\FakeContainer;
109
use ApacheBorys\Retry\Tests\Functional\Logger\FakeLogger;
1110
use ApacheBorys\Retry\Tests\Functional\Transport\PdoTransportForTests;

tests/Functional/core-test-with-container-usage.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
$factory = new HandlerFactory($config);
2323
$retry = $factory->createExceptionHandler($container);
24-
$retry->initHandler();
2524

2625
echo 'I am a test' . PHP_EOL;
2726

tests/Functional/core-test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
$factory = new HandlerFactory($config);
1111
$retry = $factory->createExceptionHandler();
12-
$retry->initHandler();
1312

1413
echo 'I am a test' . PHP_EOL;
1514

0 commit comments

Comments
 (0)