Skip to content

Commit 751439d

Browse files
committed
Running php-cs-fixer
Running php-cs-fixer to fix CS drift
1 parent d53eb90 commit 751439d

8 files changed

+8
-28
lines changed

AsyncEventDispatcher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class AsyncEventDispatcher extends AbstractAsyncEventDispatcher
66
{
7-
public function dispatch(object $event, string $eventName = null): object
7+
public function dispatch(object $event, ?string $eventName = null): object
88
{
99
$this->parentDispatch($event, $eventName);
1010

AsyncProcessor.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ public function __construct(Registry $registry, EventDispatcherInterface $dispat
2525
$this->registry = $registry;
2626

2727
if (false == $dispatcher instanceof AsyncEventDispatcher) {
28-
throw new \InvalidArgumentException(sprintf(
29-
'The dispatcher argument must be instance of "%s" but got "%s"',
30-
AsyncEventDispatcher::class,
31-
get_class($dispatcher)
32-
));
28+
throw new \InvalidArgumentException(sprintf('The dispatcher argument must be instance of "%s" but got "%s"', AsyncEventDispatcher::class, $dispatcher::class));
3329
}
3430

3531
$this->dispatcher = $dispatcher;

Commands.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
final class Commands
66
{
7-
const DISPATCH_ASYNC_EVENTS = 'symfony.dispatch_async_events';
7+
public const DISPATCH_ASYNC_EVENTS = 'symfony.dispatch_async_events';
88
}

DependencyInjection/AsyncTransformersPass.php

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
class AsyncTransformersPass implements CompilerPassInterface
99
{
10-
/**
11-
* {@inheritdoc}
12-
*/
1310
public function process(ContainerBuilder $container)
1411
{
1512
if (false == $container->hasDefinition('enqueue.events.registry')) {

EventTransformer.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,12 @@ interface EventTransformer
1212
*
1313
* @return Message
1414
*/
15-
public function toMessage($eventName, Event $event = null);
15+
public function toMessage($eventName, ?Event $event = null);
1616

1717
/**
1818
* If you able to transform message back to event return it.
1919
* If you failed to transform for some reason you can return a string status.
2020
*
21-
* @param mixed $eventNAme
22-
* @param mixed $eventName
23-
*
2421
* @return Event|string|object
2522
*
2623
* @see Process constants) or an object that implements __toString method.

PhpSerializerEventTransformer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class PhpSerializerEventTransformer extends AbstractPhpSerializerEventTransformer implements EventTransformer
88
{
9-
public function toMessage($eventName, Event $event = null)
9+
public function toMessage($eventName, ?Event $event = null)
1010
{
1111
return $this->context->createMessage(serialize($event));
1212
}

SimpleRegistry.php

+2-12
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ public function __construct(array $eventsMap, array $transformersMap)
2424
$this->transformersMap = $transformersMap;
2525
}
2626

27-
/**
28-
* {@inheritdoc}
29-
*/
3027
public function getTransformerNameForEvent($eventName)
3128
{
3229
$transformerName = null;
@@ -53,9 +50,6 @@ public function getTransformerNameForEvent($eventName)
5350
return $transformerName;
5451
}
5552

56-
/**
57-
* {@inheritdoc}
58-
*/
5953
public function getTransformer($name)
6054
{
6155
if (false == array_key_exists($name, $this->transformersMap)) {
@@ -64,12 +58,8 @@ public function getTransformer($name)
6458

6559
$transformer = $this->transformersMap[$name];
6660

67-
if (false == $transformer instanceof EventTransformer) {
68-
throw new \LogicException(sprintf(
69-
'The container must return instance of %s but got %s',
70-
EventTransformer::class,
71-
is_object($transformer) ? get_class($transformer) : gettype($transformer)
72-
));
61+
if (false == $transformer instanceof EventTransformer) {
62+
throw new \LogicException(sprintf('The container must return instance of %s but got %s', EventTransformer::class, is_object($transformer) ? $transformer::class : gettype($transformer)));
7363
}
7464

7565
return $transformer;

Tests/SimpleRegistryTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function testShouldImplementRegistryInterface()
2121
public function testShouldAllowGetTransportNameByEventName()
2222
{
2323
$registry = new SimpleRegistry([
24-
'fooEvent' => 'fooTrans',
24+
'fooEvent' => 'fooTrans',
2525
], []);
2626

2727
$this->assertEquals('fooTrans', $registry->getTransformerNameForEvent('fooEvent'));

0 commit comments

Comments
 (0)