Skip to content

Commit

Permalink
Fix #346: Fix docs for StateResetter (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Nov 20, 2023
1 parent 47368dc commit d6ab9e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ applications with tools like [Swoole](https://www.swoole.co.uk/) or [RoadRunner]
reset the state of such services every request. For this purpose you can use `StateResetter` with resetters callbacks:

```php
$resetter = new StateResetter();
$resetter = new StateResetter($container);
$resetter->setResetters([
MyServiceInterface::class => function () {
$this->reset(); // a method of MyServiceInterface
Expand Down Expand Up @@ -406,8 +406,8 @@ To manually add resetters or in case you use Yii DI composite container with a t
MyServiceInterface::class => function () {
// ...
},
StateResetter::class => function () {
$resetter = new StateResetter();
StateResetter::class => function (ContainerInterface $container) {
$resetter = new StateResetter($container);
$resetter->setResetters([
MyServiceInterface::class => function () {
$this->reset(); // a method of MyServiceInterface
Expand Down

0 comments on commit d6ab9e7

Please sign in to comment.