Skip to content

Commit f7f5568

Browse files
committed
php cs fixes
1 parent 09c58b6 commit f7f5568

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/Event/DefaultActionEvent.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ public function setTarget($target): void
118118
*/
119119
public function setParams($params): void
120120
{
121-
if (! is_array($params) && ! $params instanceof \ArrayAccess) {
122-
throw new \InvalidArgumentException('Event params are invalid. Expected type is array or \\ArrayAccess. Got ' . gettype($params));
121+
if (! \is_array($params) && ! $params instanceof \ArrayAccess) {
122+
throw new \InvalidArgumentException('Event params are invalid. Expected type is array or \\ArrayAccess. Got ' . \gettype($params));
123123
}
124124

125125
$this->params = $params;

src/Event/ProophActionEventEmitter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function dispatchUntil(ActionEvent $event, callable $callback): void
8888
*/
8989
public function attachListener(string $event, callable $listener, int $priority = 1): ListenerHandler
9090
{
91-
if (! empty($this->availableEventNames) && ! in_array($event, $this->availableEventNames, true)) {
91+
if (! empty($this->availableEventNames) && ! \in_array($event, $this->availableEventNames, true)) {
9292
throw new \InvalidArgumentException("Unknown event name given: $event");
9393
}
9494

@@ -135,7 +135,7 @@ private function getListeners(ActionEvent $event): iterable
135135
{
136136
$prioritizedListeners = $this->events[$event->getName()] ?? [];
137137

138-
krsort($prioritizedListeners, SORT_NUMERIC);
138+
\krsort($prioritizedListeners, SORT_NUMERIC);
139139

140140
foreach ($prioritizedListeners as $listenersByPriority) {
141141
foreach ($listenersByPriority as $listenerHandler) {

src/Messaging/DomainMessage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function fromArray(array $messageData): DomainMessage
4949
{
5050
MessageDataAssertion::assert($messageData);
5151

52-
$messageRef = new \ReflectionClass(get_called_class());
52+
$messageRef = new \ReflectionClass(\get_called_class());
5353

5454
/** @var $message DomainMessage */
5555
$message = $messageRef->newInstanceWithoutConstructor();
@@ -70,7 +70,7 @@ protected function init(): void
7070
}
7171

7272
if ($this->messageName === null) {
73-
$this->messageName = get_class($this);
73+
$this->messageName = \get_class($this);
7474
}
7575

7676
if ($this->createdAt === null) {

src/Messaging/FQCNMessageFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ class FQCNMessageFactory implements MessageFactory
2020
{
2121
public function createMessageFromArray(string $messageName, array $messageData): Message
2222
{
23-
if (! class_exists($messageName)) {
23+
if (! \class_exists($messageName)) {
2424
throw new \UnexpectedValueException('Given message name is not a valid class: ' . (string) $messageName);
2525
}
2626

27-
if (! is_subclass_of($messageName, DomainMessage::class)) {
28-
throw new \UnexpectedValueException(sprintf(
27+
if (! \is_subclass_of($messageName, DomainMessage::class)) {
28+
throw new \UnexpectedValueException(\sprintf(
2929
'Message class %s is not a sub class of %s',
3030
$messageName,
3131
DomainMessage::class

src/Messaging/MessageDataAssertion.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public static function assertPayload($payload): void
5959
*/
6060
private static function assertSubPayload($payload): void
6161
{
62-
if (is_array($payload)) {
62+
if (\is_array($payload)) {
6363
foreach ($payload as $subPayload) {
6464
self::assertSubPayload($subPayload);
6565
}
@@ -76,16 +76,16 @@ public static function assertMetadata($metadata): void
7676

7777
foreach ($metadata as $key => $value) {
7878
Assertion::minLength($key, 1, 'A metadata key must be non empty string');
79-
Assertion::scalar($value, 'A metadata value must have a scalar type. Got ' . gettype($value) . ' for ' . $key);
79+
Assertion::scalar($value, 'A metadata value must have a scalar type. Got ' . \gettype($value) . ' for ' . $key);
8080
}
8181
}
8282

8383
public static function assertCreatedAt($createdAt): void
8484
{
85-
Assertion::isInstanceOf($createdAt, DateTimeImmutable::class, sprintf(
85+
Assertion::isInstanceOf($createdAt, DateTimeImmutable::class, \sprintf(
8686
'created_at must be of type %s. Got %s',
8787
DateTimeImmutable::class,
88-
is_object($createdAt) ? get_class($createdAt) : gettype($createdAt)
88+
\is_object($createdAt) ? \get_class($createdAt) : \gettype($createdAt)
8989
));
9090
}
9191
}

0 commit comments

Comments
 (0)