ApiBusinessFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 18
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A createApiAuthenticator() 0 4 1
A getSecurityFacade() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Xervice\Api\Business;
5
6
7
use Xervice\Api\ApiDependencyProvider;
8
use Xervice\Api\Business\Model\Authenticator\ApiAuthenticator;
9
use Xervice\Api\Business\Model\Authenticator\ApiAuthenticatorInterface;
10
use Xervice\Core\Business\Model\Factory\AbstractBusinessFactory;
11
use Xervice\Security\Business\SecurityFacade;
12
13
/**
14
 * @method \Xervice\Api\ApiConfig getConfig()
15
 */
16
class ApiBusinessFactory extends AbstractBusinessFactory implements ApiBusinessFactoryInterface
17
{
18
    /**
19
     * @return \Xervice\Api\Business\Model\Authenticator\ApiAuthenticatorInterface
20
     */
21 3
    public function createApiAuthenticator(): ApiAuthenticatorInterface
22
    {
23 3
        return new ApiAuthenticator(
24 3
            $this->getSecurityFacade()
25
        );
26
    }
27
28
    /**
29
     * @return \Xervice\Security\Business\SecurityFacade
30
     */
31 3
    public function getSecurityFacade(): SecurityFacade
32
    {
33 3
        return $this->getDependency(ApiDependencyProvider::SECURITY_FACADE);
34
    }
35
}