Total Complexity | 5 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 0 |
1 | <?php |
||
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() |
||
73 | } |
||
74 | } |
||
75 |