Skip to content

Commit

Permalink
Merge pull request #31 from nbgrp/1.1
Browse files Browse the repository at this point in the history
Merge 1.1 to 1.2
  • Loading branch information
a-menshchikov authored Mar 19, 2023
2 parents abab83a + bb176d6 commit 5e6ccb1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
11 changes: 4 additions & 7 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
->setRiskyAllowed(true)
->setRules([
// base presets
'@PSR12' => true,
'@PER' => true,
'@PhpCsFixer' => true,
'@Symfony' => true,
'@PHP80Migration' => true,

// risky presets
'@PER:risky' => true,
'@PhpCsFixer:risky' => true,
'@Symfony:risky' => true,
'@PHP80Migration:risky' => true,
Expand All @@ -33,7 +34,7 @@
],
'blank_line_after_opening_tag' => false,
'blank_line_before_statement' => [
'statements' => ['case', 'default', 'declare', 'return', 'throw', 'try'],
'statements' => ['case', 'default', 'return', 'throw', 'try'],
],
'braces' => false,
'comment_to_phpdoc' => [
Expand Down Expand Up @@ -83,11 +84,7 @@
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
],
'single_line_comment_style' => [
'comment_types' => [
'asterisk',
],
],
'single_line_comment_style' => true,
'single_line_throw' => false,
'yoda_style' => false,

Expand Down
1 change: 0 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@
<rule ref="SlevomatCodingStandard.ControlStructures.RequireTernaryOperator" />
<rule ref="SlevomatCodingStandard.ControlStructures.UselessIfConditionWithReturn" />
<rule ref="SlevomatCodingStandard.ControlStructures.UselessTernaryOperator" />
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration" />
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction" />
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall" />
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration" />
Expand Down
4 changes: 2 additions & 2 deletions src/EventListener/User/DeferredUserListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;

#[AsEventListener]
final class DeferredUserListener
{
#[AsEventListener(CheckPassportEvent::class)]
public function dispatchDeferredEvent(CheckPassportEvent $event, string $eventName, EventDispatcherInterface $eventDispatcher): void
public function __invoke(CheckPassportEvent $event, string $eventName, EventDispatcherInterface $eventDispatcher): void
{
$badge = $event->getPassport()->getBadge(DeferredEventBadge::class);
if (!$badge instanceof DeferredEventBadge) {
Expand Down
6 changes: 3 additions & 3 deletions tests/EventListener/User/DeferredUserListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testWithoutBadge(): void
->method('dispatch')
;

(new DeferredUserListener())->dispatchDeferredEvent($event, '', $eventDispatcher);
(new DeferredUserListener())($event, '', $eventDispatcher);
}

public function testBadgeWithoutEvent(): void
Expand All @@ -49,7 +49,7 @@ public function testBadgeWithoutEvent(): void
->method('dispatch')
;

(new DeferredUserListener())->dispatchDeferredEvent($event, '', $eventDispatcher);
(new DeferredUserListener())($event, '', $eventDispatcher);
}

public function testSuccessfulEventDispatching(): void
Expand All @@ -71,6 +71,6 @@ public function testSuccessfulEventDispatching(): void
->with($deferredEvent)
;

(new DeferredUserListener())->dispatchDeferredEvent($event, '', $eventDispatcher);
(new DeferredUserListener())($event, '', $eventDispatcher);
}
}

0 comments on commit 5e6ccb1

Please sign in to comment.