Completed
Pull Request — master (#39)
by Daniel
04:05
created

ConsoleServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 24
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A registerConsoleFacade() 0 7 1
1
<?php
2
3
namespace Jellyfish\Console;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
8
class ConsoleServiceProvider implements ServiceProviderInterface
9
{
10
    /**
11
     * @param Container $container
12
     *
13
     * @return void
14
     */
15
    public function register(Container $container): void
16
    {
17
        $this->registerConsoleFacade($container);
18
    }
19
20
    /**
21
     * @param \Pimple\Container $container
22
     *
23
     * @return \Jellyfish\Console\ConsoleServiceProvider
24
     */
25
    protected function registerConsoleFacade(Container $container): ConsoleServiceProvider
26
    {
27
        $container->offsetSet(ConsoleConstants::FACADE, static function () {
28
            return new ConsoleFacade(new ConsoleFactory());
29
        });
30
31
        return $this;
32
    }
33
}
34