@@ -138,7 +138,7 @@ |
||
| 138 | 138 | */ |
| 139 | 139 | public function offsetUnset($offset): void |
| 140 | 140 | { |
| 141 | - if (! \array_key_exists($offset, $this->elements)) { |
|
| 141 | + if (!\array_key_exists($offset, $this->elements)) { |
|
| 142 | 142 | return; |
| 143 | 143 | } |
| 144 | 144 | |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | public static function normalizePresets($presets): ?array |
| 166 | 166 | { |
| 167 | 167 | // Map preset aliases to their correct value. |
| 168 | - return \array_unique(\array_filter(\array_map(static function (string $preset): string { |
|
| 168 | + return \array_unique(\array_filter(\array_map(static function(string $preset): string { |
|
| 169 | 169 | if (isset(EmojibaseShortcodeInterface::PRESET_ALIASES[$preset])) { |
| 170 | 170 | return EmojibaseShortcodeInterface::PRESET_ALIASES[$preset]; |
| 171 | 171 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | { |
| 220 | 220 | $this->assertUninitialized('Failed to add renderer.'); |
| 221 | 221 | |
| 222 | - if (! isset($this->renderersByClass[$nodeClass])) { |
|
| 222 | + if (!isset($this->renderersByClass[$nodeClass])) { |
|
| 223 | 223 | /** @var PrioritizedList<NodeRendererInterface> $renderers */ |
| 224 | 224 | $renderers = new PrioritizedList(); |
| 225 | 225 | |
@@ -310,11 +310,11 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | /** @var ListenerData $listenerData */ |
| 312 | 312 | foreach ($this->listenerData as $listenerData) { |
| 313 | - if (! \is_a($event, $listenerData->getEvent())) { |
|
| 313 | + if (!\is_a($event, $listenerData->getEvent())) { |
|
| 314 | 314 | continue; |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | - yield function (object $event) use ($listenerData): void { |
|
| 317 | + yield function(object $event) use ($listenerData): void { |
|
| 318 | 318 | $this->initialize(); |
| 319 | 319 | |
| 320 | 320 | \call_user_func($listenerData->getListener(), $event); |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | while (\class_exists($parent = (string) ($parent ?? $nodeClass)) && ($parent = \get_parent_class($parent))) { |
| 338 | - if (! isset($this->renderersByClass[$parent])) { |
|
| 338 | + if (!isset($this->renderersByClass[$parent])) { |
|
| 339 | 339 | continue; |
| 340 | 340 | } |
| 341 | 341 | |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | |
| 379 | 379 | $structuredConversionTypes = Expect::structure(\array_combine( |
| 380 | 380 | EmojiConverterInterface::TYPES, |
| 381 | - \array_map(static function (string $conversionType) use ($conversionTypes, $default): Schema { |
|
| 381 | + \array_map(static function(string $conversionType) use ($conversionTypes, $default): Schema { |
|
| 382 | 382 | return Expect::anyOf(false, ...$conversionTypes)->default($default)->nullable(); |
| 383 | 383 | }, EmojiConverterInterface::TYPES) |
| 384 | 384 | ))->castTo('array'); |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | */ |
| 129 | 129 | public function setInput($input): void |
| 130 | 130 | { |
| 131 | - if (! \mb_check_encoding($input, 'UTF-8')) { |
|
| 131 | + if (!\mb_check_encoding($input, 'UTF-8')) { |
|
| 132 | 132 | throw new UnexpectedEncodingException('Unexpected encoding - UTF-8 or ASCII was expected'); |
| 133 | 133 | } |
| 134 | 134 | |
@@ -44,12 +44,12 @@ |
||
| 44 | 44 | */ |
| 45 | 45 | public function render(Node $node) |
| 46 | 46 | { |
| 47 | - if (! ($node instanceof Image)) { |
|
| 47 | + if (!($node instanceof Image)) { |
|
| 48 | 48 | throw new \InvalidArgumentException('Incompatible node type: ' . \get_class($node)); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $allowUnsafeLinks = (bool) $this->config->get('allow_unsafe_links'); |
| 52 | - if (! $allowUnsafeLinks && self::isLinkPotentiallyUnsafe($node->getUrl())) { |
|
| 52 | + if (!$allowUnsafeLinks && self::isLinkPotentiallyUnsafe($node->getUrl())) { |
|
| 53 | 53 | $node->setAttribute('src', ''); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | // Ensure emojis are set to the correct stringable type. |
| 37 | 37 | foreach ($e->getDocument()->getNodes() as $node) { |
| 38 | - if (! ($node instanceof Emoji)) { |
|
| 38 | + if (!($node instanceof Emoji)) { |
|
| 39 | 39 | continue; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $type = (string) $this->config->get('twemoji.type'); |
| 42 | 42 | |
| 43 | 43 | foreach ($e->getDocument()->getNodes() as $node) { |
| 44 | - if (! ($node instanceof Emoji) || $node->hexcode === null) { |
|
| 44 | + if (!($node instanceof Emoji) || $node->hexcode === null) { |
|
| 45 | 45 | continue; |
| 46 | 46 | } |
| 47 | 47 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | if ($inline && $size === null) { |
| 83 | 83 | $image->setAttribute('style', 'width: 1em; height: 1em; vertical-align: middle;'); |
| 84 | 84 | } elseif ($inline && $size !== null) { |
| 85 | - if (! \is_string($size)) { |
|
| 85 | + if (!\is_string($size)) { |
|
| 86 | 86 | $size .= 'em'; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | $this->lexer->moveNext(); |
| 52 | 52 | |
| 53 | 53 | while (true) { |
| 54 | - if (! $this->lexer->lookahead) { |
|
| 54 | + if (!$this->lexer->lookahead) { |
|
| 55 | 55 | break; |
| 56 | 56 | } |
| 57 | 57 | |