1 | <?php |
||||||
2 | |||||||
3 | /** |
||||||
4 | * (c) FSi sp. z o.o. <[email protected]> |
||||||
5 | * |
||||||
6 | * For the full copyright and license information, please view the LICENSE |
||||||
7 | * file that was distributed with this source code. |
||||||
8 | */ |
||||||
9 | |||||||
10 | declare(strict_types=1); |
||||||
11 | |||||||
12 | namespace FSi\Bundle\AdminSecurityBundle\Doctrine\Admin; |
||||||
13 | |||||||
14 | use FSi\Bundle\AdminBundle\Doctrine\Admin\BatchElement; |
||||||
15 | use FSi\Bundle\AdminSecurityBundle\Event\AdminSecurityEvents; |
||||||
16 | use FSi\Bundle\AdminSecurityBundle\Event\ResetPasswordRequestEvent; |
||||||
17 | use FSi\Bundle\AdminSecurityBundle\Security\User\ResettablePasswordInterface; |
||||||
18 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
||||||
19 | |||||||
20 | class PasswordResetBatchElement extends BatchElement |
||||||
21 | { |
||||||
22 | /** |
||||||
23 | * @var string |
||||||
24 | */ |
||||||
25 | private $userModel; |
||||||
26 | |||||||
27 | /** |
||||||
28 | * @var EventDispatcherInterface |
||||||
29 | */ |
||||||
30 | private $eventDispatcher; |
||||||
31 | |||||||
32 | public function __construct(array $options, string $userModel, EventDispatcherInterface $eventDispatcher) |
||||||
33 | { |
||||||
34 | parent::__construct($options); |
||||||
35 | |||||||
36 | $this->userModel = $userModel; |
||||||
37 | $this->eventDispatcher = $eventDispatcher; |
||||||
38 | } |
||||||
39 | |||||||
40 | /** |
||||||
41 | * @param ResettablePasswordInterface $object |
||||||
42 | */ |
||||||
43 | public function apply($object): void |
||||||
44 | { |
||||||
45 | $this->eventDispatcher->dispatch( |
||||||
46 | AdminSecurityEvents::RESET_PASSWORD_REQUEST, |
||||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
47 | new ResetPasswordRequestEvent($object) |
||||||
0 ignored issues
–
show
The call to
Symfony\Contracts\EventD...erInterface::dispatch() has too many arguments starting with new FSi\Bundle\AdminSecu...rdRequestEvent($object) .
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue. If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above. ![]() |
|||||||
48 | ); |
||||||
49 | } |
||||||
50 | |||||||
51 | public function getId(): string |
||||||
52 | { |
||||||
53 | return 'admin_security_password_reset'; |
||||||
54 | } |
||||||
55 | |||||||
56 | public function getClassName(): string |
||||||
57 | { |
||||||
58 | return $this->userModel; |
||||||
59 | } |
||||||
60 | } |
||||||
61 |