Test Failed
Push — master ( ffc597...4abc3b )
by Julien
12:58 queued 09:01
created

AbstractServiceProvider::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 0
c 0
b 0
f 0
dl 0
loc 2
ccs 0
cts 0
cp 0
rs 10
cc 1
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * This file is part of the Zemit Framework.
4
 *
5
 * (c) Zemit Team <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE.txt
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Zemit\Provider;
12
13
use LogicException;
14
use Phalcon\Di\DiInterface;
15
use Zemit\Di\Injectable;
16
17
/**
18
 * Class AbstractServiceProvider
19
 *
20
 * @author Julien Turbide <[email protected]>
21
 * @copyright Zemit Team <[email protected]>
22
 *
23
 * @since 1.0
24
 * @version 1.0
25
 *
26
 * @package Zemit\Provider
27
 */
28
abstract class AbstractServiceProvider extends Injectable implements ServiceProviderInterface
29
{
30
    /**
31
     * The Service name.
32
     * @var string
33
     */
34
    protected $serviceName;
35
    
36 4
    final public function __construct(DiInterface $di)
37
    {
38 4
        if (!$this->serviceName) {
39
            throw new LogicException(
40
                sprintf('The service provider defined in "%s" cannot have an empty name.', get_class($this))
41
            );
42
        }
43 4
        $this->setDI($di);
44 4
        $this->configure();
45
    }
46
    
47
    /**
48
     * {@inheritdoc}
49
     *
50
     * @return string
51
     */
52 4
    public function getName()
53
    {
54 4
        return $this->serviceName;
55
    }
56
    
57
    /**
58
     * {@inheritdoc}
59
     *
60
     * @return void
61
     */
62
    public function boot()
63
    {
64
    }
65
    
66
    /**
67
     * {@inheritdoc}
68
     *
69
     * @return void
70
     */
71
    public function configure()
72
    {
73
    }
74
}
75