FinderSymfonyServiceProvider::register()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Jellyfish\FinderSymfony;
6
7
use Pimple\Container;
8
use Pimple\ServiceProviderInterface;
9
10
class FinderSymfonyServiceProvider implements ServiceProviderInterface
11
{
12
    /**
13
     * @param \Pimple\Container $pimple
14
     *
15
     * @return void
16
     */
17
    public function register(Container $pimple): void
18
    {
19
        $this->registerFinderFactory($pimple);
20
    }
21
22
    /**
23
     * @param \Pimple\Container $container
24
     *
25
     * @return \Jellyfish\FinderSymfony\FinderSymfonyServiceProvider
26
     */
27
    protected function registerFinderFactory(Container $container): FinderSymfonyServiceProvider
28
    {
29
        $container->offsetSet('finder_factory', function () {
30
            return new FinderFactory();
31
        });
32
33
        return $this;
34
    }
35
}
36