| Total Complexity | 3 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | class LockSymfonyServiceProvider implements ServiceProviderInterface |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @param \Pimple\Container $pimple |
||
| 14 | * |
||
| 15 | * @return void |
||
| 16 | */ |
||
| 17 | public function register(Container $pimple): void |
||
| 18 | { |
||
| 19 | $this->createLockFactory($pimple); |
||
| 20 | } |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @param \Pimple\Container $container |
||
| 24 | * |
||
| 25 | * @return \Pimple\ServiceProviderInterface |
||
| 26 | */ |
||
| 27 | protected function createLockFactory(Container $container): ServiceProviderInterface |
||
| 28 | { |
||
| 29 | $self = $this; |
||
| 30 | |||
| 31 | $container->offsetSet('lock_factory', function (Container $container) use ($self) { |
||
| 32 | return new LockFactory($self->createSymfonyLockFactory($container)); |
||
| 33 | }); |
||
| 34 | |||
| 35 | return $this; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param \Pimple\Container $container |
||
| 40 | * |
||
| 41 | * @return \Symfony\Component\Lock\Factory |
||
| 42 | */ |
||
| 43 | protected function createSymfonyLockFactory(Container $container): SymfonyLockFactory |
||
| 48 | } |
||
| 49 | } |
||
| 50 |