Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 1.1 to 1.2 #31

Merged
merged 3 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}