@@ -10,7 +10,7 @@ |
||
10 | 10 | { |
11 | 11 | public function __construct(string $filename, ?string $message = null, ?Throwable $previous = null) |
12 | 12 | { |
13 | - if (! isset($message)) { |
|
13 | + if (!isset($message)) { |
|
14 | 14 | $message = \sprintf('Empty or corrupted archive: %s.', $filename); |
15 | 15 | } |
16 | 16 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function offsetExists($index) // phpcs:ignore |
49 | 49 | { |
50 | - if (! \array_key_exists($index, $this->getArrayCopy())) { |
|
50 | + if (!\array_key_exists($index, $this->getArrayCopy())) { |
|
51 | 51 | throw new \OutOfRangeException(\sprintf('Unknown property: %s', $index)); |
52 | 52 | } |
53 | 53 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | $method = 'get' . \ucfirst(\substr($key, 0, 3) === 'get' ? \substr($key, 3) : $key); |
69 | - if (! \method_exists($this, $method)) { |
|
69 | + if (!\method_exists($this, $method)) { |
|
70 | 70 | throw new \OutOfRangeException(\sprintf('Unknown property: %s', $key)); |
71 | 71 | } |
72 | 72 |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | \preg_match(self::REGEX, $type, $matches, PREG_UNMATCHED_AS_NULL); |
37 | 37 | $this->callback = (string) ($matches['callback'] ?? null); |
38 | 38 | $this->customType = (string) ($matches['customType'] ?? null); |
39 | - $this->emptyNullable = ! ! ($matches['emptyNullable'] ?? false); |
|
40 | - $this->iterable = ! ! ($matches['iterable'] ?? false); |
|
41 | - $this->nullable = ! ! ($this->emptyNullable || ($matches['nullable'] ?? false)); |
|
39 | + $this->emptyNullable = !!($matches['emptyNullable'] ?? false); |
|
40 | + $this->iterable = !!($matches['iterable'] ?? false); |
|
41 | + $this->nullable = !!($this->emptyNullable || ($matches['nullable'] ?? false)); |
|
42 | 42 | $this->type = (string) ($matches['type'] ?? 'mixed'); |
43 | 43 | $this->isPhpType = \in_array($this->type, self::TYPES, true); |
44 | 44 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | public function castValue($value) |
80 | 80 | { |
81 | 81 | // Immediately return if nullable or empty. |
82 | - if (($this->nullable && $value === null) || ($this->emptyNullable && ! $value)) { |
|
82 | + if (($this->nullable && $value === null) || ($this->emptyNullable && !$value)) { |
|
83 | 83 | return null; |
84 | 84 | } |
85 | 85 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | Normalize::setType($value, $this->type); |
127 | 127 | } |
128 | 128 | |
129 | - return $this->emptyNullable && ! $value |
|
129 | + return $this->emptyNullable && !$value |
|
130 | 130 | ? null |
131 | 131 | : $value; |
132 | 132 | } |
@@ -87,11 +87,11 @@ |
||
87 | 87 | |
88 | 88 | /** @var ListenerData $listenerData */ |
89 | 89 | foreach ($this->listenerData as $listenerData) { |
90 | - if (! \is_a($event, $listenerData->getEvent())) { |
|
90 | + if (!\is_a($event, $listenerData->getEvent())) { |
|
91 | 91 | continue; |
92 | 92 | } |
93 | 93 | |
94 | - yield function (object $event) use ($listenerData): void { |
|
94 | + yield function(object $event) use ($listenerData): void { |
|
95 | 95 | $this->initialize(); |
96 | 96 | |
97 | 97 | \call_user_func($listenerData->getListener(), $event); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | $this->lexer->moveNext(); |
71 | 71 | |
72 | 72 | while (true) { |
73 | - if (! $this->lexer->lookahead) { |
|
73 | + if (!$this->lexer->lookahead) { |
|
74 | 74 | break; |
75 | 75 | } |
76 | 76 | |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | protected function parseEmoji(int $type, string $value) |
92 | 92 | { |
93 | 93 | // Immediately return if not a valid type. |
94 | - if (! isset(self::T_DATASETS[$type])) { |
|
94 | + if (!isset(self::T_DATASETS[$type])) { |
|
95 | 95 | return null; |
96 | 96 | } |
97 | 97 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $emoji = $dataset->offsetGet($value); |
103 | 103 | |
104 | 104 | // Return if not an emoji. |
105 | - if (! $emoji) { |
|
105 | + if (!$emoji) { |
|
106 | 106 | return null; |
107 | 107 | } |
108 | 108 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $this->next = $sibling; |
100 | 100 | $sibling->setParent($this->parent); |
101 | 101 | |
102 | - if (! $sibling->next && $sibling->parent) { |
|
102 | + if (!$sibling->next && $sibling->parent) { |
|
103 | 103 | $sibling->parent->lastChild = $sibling; |
104 | 104 | } |
105 | 105 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $this->previous = $sibling; |
121 | 121 | $sibling->setParent($this->parent); |
122 | 122 | |
123 | - if (! $sibling->previous && $sibling->parent) { |
|
123 | + if (!$sibling->previous && $sibling->parent) { |
|
124 | 124 | $sibling->parent->firstChild = $sibling; |
125 | 125 | } |
126 | 126 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | protected function setParent(?Node $node = null): void |
42 | 42 | { |
43 | - if ($node && ! $node instanceof self) { |
|
43 | + if ($node && !$node instanceof self) { |
|
44 | 44 | throw new \InvalidArgumentException('Parent of block must also be block (cannot be inline)'); |
45 | 45 | } |
46 | 46 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | public function __construct(string $content, int $lineOffset = 0) |
49 | 49 | { |
50 | - if (! \mb_check_encoding($content, 'UTF-8')) { |
|
50 | + if (!\mb_check_encoding($content, 'UTF-8')) { |
|
51 | 51 | throw new UnexpectedEncodingException('Unexpected encoding - UTF-8 or ASCII was expected'); |
52 | 52 | } |
53 | 53 |
@@ -100,7 +100,7 @@ |
||
100 | 100 | /** @var ?static $skin */ |
101 | 101 | $skin = \current( |
102 | 102 | $this->skins->filter( |
103 | - static function (Emoji $emoji) use ($tone) { |
|
103 | + static function(Emoji $emoji) use ($tone) { |
|
104 | 104 | return \in_array($tone, (array) $emoji->tone, true); |
105 | 105 | } |
106 | 106 | )->getArrayCopy() |