File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -177,4 +177,18 @@ public function testReverse()
177
177
$ this ->expectException (\IntlException::class);
178
178
EmojiTransliterator::create ('emoji-en ' , EmojiTransliterator::REVERSE );
179
179
}
180
+
181
+ public function testGetErrorCodeWithUninitializedTransliterator ()
182
+ {
183
+ $ transliterator = EmojiTransliterator::create ('emoji-en ' );
184
+
185
+ $ this ->assertSame (0 , $ transliterator ->getErrorCode ());
186
+ }
187
+
188
+ public function testGetErrorMessageWithUninitializedTransliterator ()
189
+ {
190
+ $ transliterator = EmojiTransliterator::create ('emoji-en ' );
191
+
192
+ $ this ->assertFalse ($ transliterator ->getErrorMessage ());
193
+ }
180
194
}
Original file line number Diff line number Diff line change @@ -72,12 +72,12 @@ public function createInverse(): self
72
72
73
73
public function getErrorCode (): int |false
74
74
{
75
- return $ this ->transliterator ?-> getErrorCode() ?? 0 ;
75
+ return isset ( $ this ->transliterator ) ? $ this -> transliterator -> getErrorCode () : 0 ;
76
76
}
77
77
78
78
public function getErrorMessage (): string |false
79
79
{
80
- return $ this ->transliterator ?-> getErrorMessage() ?? false ;
80
+ return isset ( $ this ->transliterator ) ? $ this -> transliterator -> getErrorMessage () : false ;
81
81
}
82
82
83
83
public static function listIDs (): array
You can’t perform that action at this time.
0 commit comments