Passed
Push — master ( 9e7bb0...3dbea0 )
by Mike
04:24
created

ApiBusinessFactory::createApiAuthenticator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 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
}