@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | \implode( |
186 | 186 | ', ', |
187 | 187 | \array_map( |
188 | - static function ($s) { |
|
188 | + static function($s) { |
|
189 | 189 | return \sprintf('"%s"', $s); |
190 | 190 | }, |
191 | 191 | EmojibaseShortcodeInterface::SUPPORTED_PRESETS |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | ): EnvironmentBuilderInterface { |
261 | 261 | $this->assertUninitialized('Failed to add renderer.'); |
262 | 262 | |
263 | - if (! isset($this->renderersByClass[$nodeClass])) { |
|
263 | + if (!isset($this->renderersByClass[$nodeClass])) { |
|
264 | 264 | /** @var PrioritizedList<NodeRendererInterface> $renderers */ |
265 | 265 | $renderers = new PrioritizedList(); |
266 | 266 | |
@@ -354,11 +354,11 @@ discard block |
||
354 | 354 | |
355 | 355 | /** @var ListenerData $listenerData */ |
356 | 356 | foreach ($this->listenerData as $listenerData) { |
357 | - if (! \is_a($event, $listenerData->getEvent())) { |
|
357 | + if (!\is_a($event, $listenerData->getEvent())) { |
|
358 | 358 | continue; |
359 | 359 | } |
360 | 360 | |
361 | - yield function (object $event) use ($listenerData): void { |
|
361 | + yield function(object $event) use ($listenerData): void { |
|
362 | 362 | $this->initialize(); |
363 | 363 | |
364 | 364 | \call_user_func($listenerData->getListener(), $event); |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | } |
391 | 391 | |
392 | 392 | while (\class_exists($parent = (string) ($parent ?? $nodeClass)) && ($parent = \get_parent_class($parent))) { |
393 | - if (! isset($this->renderersByClass[$parent])) { |
|
393 | + if (!isset($this->renderersByClass[$parent])) { |
|
394 | 394 | continue; |
395 | 395 | } |
396 | 396 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | */ |
12 | 12 | public function __construct(string $locale, array $throwables = []) |
13 | 13 | { |
14 | - if (! $throwables) { |
|
14 | + if (!$throwables) { |
|
15 | 15 | parent::__construct(\sprintf( |
16 | 16 | 'Attempted to load the locale "%s" dataset. No viable presets were provided. Did you accidentally disable the "native" configuration and only provide that preset?', |
17 | 17 | $locale |
@@ -42,12 +42,12 @@ |
||
42 | 42 | // Ensure emojis are set to the correct stringable type. |
43 | 43 | $walker = $e->getDocument()->walker(); |
44 | 44 | while ($event = $walker->next()) { |
45 | - if (! $event->isEntering()) { |
|
45 | + if (!$event->isEntering()) { |
|
46 | 46 | continue; |
47 | 47 | } |
48 | 48 | |
49 | 49 | $node = $event->getNode(); |
50 | - if (! ($node instanceof Emoji)) { |
|
50 | + if (!($node instanceof Emoji)) { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | 53 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | $walker = $e->getDocument()->walker(); |
42 | 42 | while ($event = $walker->next()) { |
43 | 43 | $node = $event->getNode(); |
44 | - if (! ($node instanceof Emoji) || $node->hexcode === null) { |
|
44 | + if (!($node instanceof Emoji) || $node->hexcode === null) { |
|
45 | 45 | continue; |
46 | 46 | } |
47 | 47 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $this->lexer->moveNext(); |
68 | 68 | |
69 | 69 | while (true) { |
70 | - if (! $this->lexer->lookahead) { |
|
70 | + if (!$this->lexer->lookahead) { |
|
71 | 71 | break; |
72 | 72 | } |
73 | 73 | |
@@ -94,12 +94,12 @@ discard block |
||
94 | 94 | protected function parseEmoji(int $type, string $value): ?Emoji |
95 | 95 | { |
96 | 96 | // Immediately return if not a valid type. |
97 | - if (! isset(self::INDICES[$type])) { |
|
97 | + if (!isset(self::INDICES[$type])) { |
|
98 | 98 | return null; |
99 | 99 | } |
100 | 100 | |
101 | 101 | // Return if no emoji could be found. |
102 | - if (! ($emoji = $this->environment->getRuntimeDataset(self::INDICES[$type])->offsetGet($value))) { |
|
102 | + if (!($emoji = $this->environment->getRuntimeDataset(self::INDICES[$type])->offsetGet($value))) { |
|
103 | 103 | return null; |
104 | 104 | } |
105 | 105 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $this->lexer->moveNext(); |
121 | 121 | } |
122 | 122 | |
123 | - if (! $text) { |
|
123 | + if (!$text) { |
|
124 | 124 | return null; |
125 | 125 | } |
126 | 126 |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | |
57 | 57 | public static function unarchive(string $filename): Dataset |
58 | 58 | { |
59 | - if (! \file_exists($filename)) { |
|
59 | + if (!\file_exists($filename)) { |
|
60 | 60 | throw new FileNotFoundException($filename); |
61 | 61 | } |
62 | 62 | |
63 | 63 | if ( |
64 | - ! ($contents = \file_get_contents($filename)) || |
|
65 | - ! ($decoded = \gzdecode($contents)) |
|
64 | + !($contents = \file_get_contents($filename)) || |
|
65 | + !($decoded = \gzdecode($contents)) |
|
66 | 66 | ) { |
67 | 67 | throw new UnarchiveException($filename); |
68 | 68 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | throw new MalformedArchiveException($filename, $throwable); |
75 | 75 | } |
76 | 76 | |
77 | - if (! $dataset instanceof Dataset) { |
|
77 | + if (!$dataset instanceof Dataset) { |
|
78 | 78 | throw new MalformedArchiveException($filename); |
79 | 79 | } |
80 | 80 |
@@ -128,7 +128,7 @@ |
||
128 | 128 | public function getSkin(int $tone = EmojibaseSkinsInterface::LIGHT_SKIN): ?self |
129 | 129 | { |
130 | 130 | /** @var ?static $skin */ |
131 | - $skin = \current($this->skins->filter(static function (Emoji $emoji) use ($tone) { |
|
131 | + $skin = \current($this->skins->filter(static function(Emoji $emoji) use ($tone) { |
|
132 | 132 | return \in_array($tone, (array) $emoji->tone, true); |
133 | 133 | })->getArrayCopy()) ?: null; |
134 | 134 |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | public function indexBy(string $index = 'hexcode'): Dataset |
47 | 47 | { |
48 | - if (! isset($this->indices[$index])) { |
|
48 | + if (!isset($this->indices[$index])) { |
|
49 | 49 | $this->indices[$index] = new self($this, $index); |
50 | 50 | } |
51 | 51 |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | // order to keep '__' to stay '__' we first replace it with a different |
86 | 86 | // placeholder after checking that it is not defined as a filter. |
87 | 87 | $doubleUnderscoreReplacements = 0; |
88 | - if (! isset($filter['__'])) { |
|
88 | + if (!isset($filter['__'])) { |
|
89 | 89 | $identifier = \str_replace('__', '##', $identifier, $doubleUnderscoreReplacements); |
90 | 90 | } |
91 | 91 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $classes = \array_merge([(string) ($this->attributes['class'] ?? '')], $classes); |
118 | 118 | |
119 | 119 | /** @var string[] $classes */ |
120 | - $classes = \array_filter(\iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveArrayIterator(\array_map(static function (string $class) { |
|
120 | + $classes = \array_filter(\iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveArrayIterator(\array_map(static function(string $class) { |
|
121 | 121 | return \explode(' ', $class); |
122 | 122 | }, $classes))))); |
123 | 123 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function getAttribute(string $key) |
150 | 150 | { |
151 | - if (! isset($this->attributes[$key])) { |
|
151 | + if (!isset($this->attributes[$key])) { |
|
152 | 152 | return null; |
153 | 153 | } |
154 | 154 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | public function setAttribute(string $key, $value): self |
162 | 162 | { |
163 | 163 | if ($key === 'class') { |
164 | - if (! \is_array($value)) { |
|
164 | + if (!\is_array($value)) { |
|
165 | 165 | $value = [$value]; |
166 | 166 | } |
167 | 167 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public function getContents(bool $asString = true) |
185 | 185 | { |
186 | - if (! $asString) { |
|
186 | + if (!$asString) { |
|
187 | 187 | return $this->contents; |
188 | 188 | } |
189 | 189 |