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, |
|
|
|
|
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
|
|
|
} |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.