Passed
Push — main ( 79e4f1...ed1bb6 )
by Slawomir
04:28
created

SecurityApi   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 11
c 2
b 0
f 0
dl 0
loc 41
ccs 0
cts 0
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 1
1
<?php
2
3
namespace App\Modules\Security\Domain;
4
5
use App\Infrastructure\Events\Api\ApplicationEventPublisherInterface;
6
use App\Infrastructure\Security\LoggedInUserProviderInterface;
7
use App\Modules\Security\Api\SecurityApiInterface;
8
use App\Modules\Security\Domain\Logic\JWTSecurityListener;
9
use App\Modules\Security\Domain\Logic\SecurityValidator;
10
use App\Modules\Security\Domain\Logic\UserCreator;
11
use App\Modules\Security\Domain\Logic\UserUpdater;
12
use App\Modules\Security\Domain\Repository\UserCreationRepositoryInterface;
13
use App\Modules\Security\Domain\Repository\UserFindingRepositoryInterface;
14
use App\Modules\Security\Domain\Repository\UserUpdatingRepositoryInterface;
15
use App\Modules\Security\Domain\Transactions\SecurityTransactionFactoryInterface;
16
use Psr\Log\LoggerInterface;
17
use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface;
18
use Symfony\Component\Validator\Validator\ValidatorInterface;
19
20
class SecurityApi implements SecurityApiInterface
21
{
22
    use UserCreator {
23
        UserCreator::__construct as __userCreatorConstruct;
24
    }
25
26
    use UserUpdater {
27
        UserUpdater::__construct as __userUpdaterConstruct;
28
    }
29
30
    use JWTSecurityListener {
31
        JWTSecurityListener::__construct as __jwtTokenDecoratorConstruct;
32
    }
33
34
    /**
35
     * @param SecurityTransactionFactoryInterface $transactionFactory
36
     * @param UserPasswordHasherInterface $passwordHasher
37
     * @param UserCreationRepositoryInterface $creationRepository
38
     * @param LoggedInUserProviderInterface $databaseLoggedInUserProvider
39
     * @param UserUpdatingRepositoryInterface $updatingRepository
40
     * @param UserFindingRepositoryInterface $findingRepository
41
     * @param LoggerInterface $logger
42
     * @param ValidatorInterface $validator
43
     * @param ApplicationEventPublisherInterface $eventPublisher
44
     */
45
    public function __construct(
46
        SecurityTransactionFactoryInterface $transactionFactory,
47
        UserPasswordHasherInterface         $passwordHasher,
48
        UserCreationRepositoryInterface     $creationRepository,
49
        LoggedInUserProviderInterface       $databaseLoggedInUserProvider,
50
        UserUpdatingRepositoryInterface     $updatingRepository,
51
        UserFindingRepositoryInterface      $findingRepository,
52
        LoggerInterface                     $logger,
0 ignored issues
show
Unused Code introduced by
The parameter $logger is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

52
        /** @scrutinizer ignore-unused */ LoggerInterface                     $logger,

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
53
        ValidatorInterface                  $validator,
54
        ApplicationEventPublisherInterface  $eventPublisher
55
    )
56
    {
57
        $securityValidator = new SecurityValidator($validator, $findingRepository);
58
        $this->__userUpdaterConstruct($eventPublisher, $transactionFactory, $updatingRepository, $securityValidator, $passwordHasher);
59
        $this->__userCreatorConstruct($passwordHasher, $transactionFactory, $creationRepository, $securityValidator);
60
        $this->__jwtTokenDecoratorConstruct($databaseLoggedInUserProvider);
61
    }
62
}