ApiBusinessFactory::getSecurityFacade()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 2
cts 2
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
}