8000 bug #60340 [String] fix EmojiTransliterator return type compatibility… · symfony/symfony@6b4f603 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b4f603

Browse files
committed
bug #60340 [String] fix EmojiTransliterator return type compatibility with PHP 8.5 (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [String] fix EmojiTransliterator return type compatibility with PHP 8.5 | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT see php/php-src#18470 Commits ------- 19df3db fix EmojiTransliterator return type compatibility with PHP 8.5
2 parents f43ca7e + 19df3db commit 6b4f603

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

.github/expected-missing-return-types.diff

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8923,6 +8923,23 @@ diff --git a/src/Symfony/Component/Intl/Data/Bundle/Writer/BundleWriterInterface
89238923
- public function write(string $path, string $locale, mixed $data);
89248924
+ public function write(string $path, string $locale, mixed $data): void;
89258925
}
8926+
diff --git a/src/Symfony/Component/Intl/Transliterator/EmojiTransliterator.php b/src/Symfony/Component/Intl/Transliterator/EmojiTransliterator.php
8927+
--- a/src/Symfony/Component/Intl/Transliterator/EmojiTransliterator.php
8928+
+++ b/src/Symfony/Component/Intl/Transliterator/EmojiTransliterator.php
8929+
@@ -74,5 +74,5 @@ if (!class_exists(\Transliterator::class)) {
8930+
*/
8931+
#[\ReturnTypeWillChange]
8932+
- public function getErrorCode(): int|false
8933+
+ public function getErrorCode(): int
8934+
{
8935+
return isset($this->transliterator) ? $this->transliterator->getErrorCode() : 0;
8936+
@@ -83,5 +83,5 @@ if (!class_exists(\Transliterator::class)) {
8937+
*/
8938+
#[\ReturnTypeWillChange]
8939+
- public function getErrorMessage(): string|false
8940+
+ public function getErrorMessage(): string
8941+
{
8942+
return isset($this->transliterator) ? $this->transliterator->getErrorMessage() : '';
89268943
diff --git a/src/Symfony/Component/Intl/Util/IntlTestHelper.php b/src/Symfony/Component/Intl/Util/IntlTestHelper.php
89278944
--- a/src/Symfony/Component/Intl/Util/IntlTestHelper.php
89288945
+++ b/src/Symfony/Component/Intl/Util/IntlTestHelper.php

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)
0