Skip to content

Commit aaa4f30

Browse files
committed
Fixes compatibility with old versions
1 parent dbc6b4a commit aaa4f30

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/Str.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ public static function splitCamelCase(string $input, string $separator = '_', bo
679679
public static function testName2Human(string $input): string
680680
{
681681
$original = $input;
682-
$input = (string)self::getClassName($input);
682+
$input = self::getClassName($input);
683683

684684
/** @noinspection NotOptimalRegularExpressionsInspection */
685685
if (!preg_match('#^tests#i', $input)) {
@@ -748,12 +748,12 @@ public static function uuid(): string
748748
*
749749
* @param mixed $object
750750
* @param bool $toLower
751-
* @return string|null
751+
* @return string
752752
*/
753-
public static function getClassName($object, bool $toLower = false): ?string
753+
public static function getClassName($object, bool $toLower = false): string
754754
{
755755
if (!$object) {
756-
return null;
756+
return '';
757757
}
758758

759759
$className = $object;

tests/StringTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public function testGenerateUUID(): void
326326

327327
public function testGetClassName(): void
328328
{
329-
isSame(null, Str::getClassName(null));
329+
isSame('', Str::getClassName(null));
330330
isSame('JBZoo', Str::getClassName('JBZoo'));
331331
isSame('JBZoo', Str::getClassName('\JBZoo'));
332332
isSame('CCK', Str::getClassName('\JBZoo\CCK'));

0 commit comments

Comments
 (0)