HelloWorld   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 27
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 9 1
1
<?php
2
/**
3
 * @author    Harry Osmar Sitohang <[email protected]>
4
 * @copyright 2018 Wayfair LLC - All rights reserved
5
 */
6
7
namespace PhpBootstrap\ServiceProviders\Controller;
8
9
use League\Container\ServiceProvider\AbstractServiceProvider;
10
use PhpBootstrap\Services\Hello;
11
12
class HelloWorld extends AbstractServiceProvider
13
{
14
15
    /**
16
     * @var array
17
     */
18
    protected $provides = [
19
        \PhpBootstrap\Contracts\Hello::class
20
    ];
21
22
    /**
23
     * Use the register method to register items with the container via the
24
     * protected $this->container property or the `getContainer` method
25
     * from the ContainerAwareTrait.
26
     *
27
     * @return void
28
     */
29
    public function register()
30
    {
31
        /**
32
         * by registering the helloworld implementation as an alias of it's interface it
33
         * is easy to swap out for other implementations
34
         */
35
        $this->getContainer()
36
            ->add(\PhpBootstrap\Contracts\Hello::class, Hello::class);
37
    }
38
}