Passed
Push — master ( f0a715...da0ac6 )
by Mike
02:11
created

KernelFacade   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 75%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 20
ccs 6
cts 8
cp 0.75
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getService() 0 3 1
A boot() 0 3 1
A run() 0 3 1
1
<?php
2
3
4
namespace Xervice\Kernel;
5
6
7
use Xervice\Core\Facade\AbstractFacade;
8
use Xervice\Kernel\Business\Service\ServiceInterface;
9
10
/**
11
 * @method \Xervice\Kernel\KernelFactory getFactory()
12
 */
13
class KernelFacade extends AbstractFacade
14
{
15 1
    public function boot(): void
16
    {
17 1
        $this->getFactory()->getServiceProvider()->boot();
18 1
    }
19
20 1
    public function run(): void
21
    {
22 1
        $this->getFactory()->getServiceProvider()->execute();
23 1
    }
24
25
    /**
26
     * @param string $serviceName
27
     *
28
     * @return \Xervice\Kernel\Business\Service\ServiceInterface
29
     */
30
    public function getService(string $serviceName): ServiceInterface
31
    {
32
        return $this->getFactory()->getServiceProvider()->get($serviceName);
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->getFactory...er()->get($serviceName) could return the type null which is incompatible with the type-hinted return Xervice\Kernel\Business\Service\ServiceInterface. Consider adding an additional type-check to rule them out.
Loading history...
33
    }
34
}
35