Skip to content

Commit a42804f

Browse files
committed
fix EmojiTransliterator return type compatibility with PHP 8.5
1 parent f43ca7e commit a42804f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/Symfony/Component/Intl/Tests/Transliterator/EmojiTransliteratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,6 @@ public function testGetErrorMessageWithUninitializedTransliterator()
189189
{
190190
$transliterator = EmojiTransliterator::create('emoji-en');
191191

192-
$this->assertFalse($transliterator->getErrorMessage());
192+
$this->assertSame('', $transliterator->getErrorMessage());
193193
}
194194
}

src/Symfony/Component/Intl/Transliterator/EmojiTransliterator.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,22 @@ public function createInverse(): self
7070
return self::create($this->id, self::REVERSE);
7171
}
7272

73+
/**
74+
* @return int
75+
*/
76+
#[\ReturnTypeWillChange]
7377
public function getErrorCode(): int|false
7478
{
7579
return isset($this->transliterator) ? $this->transliterator->getErrorCode() : 0;
7680
}
7781

82+
/**
83+
* @return string
84+
*/
85+
#[\ReturnTypeWillChange]
7886
public function getErrorMessage(): string|false
7987
{
80-
return isset($this->transliterator) ? $this->transliterator->getErrorMessage() : false;
88+
return isset($this->transliterator) ? $this->transliterator->getErrorMessage() : '';
8189
}
8290

8391
public static function listIDs(): array

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy