-
Notifications
You must be signed in to change notification settings - Fork 497
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes phpstan/phpstan#6697 Closes phpstan/phpstan#6443
- Loading branch information
1 parent
2cd83b2
commit a838bb4
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Bug6443; | ||
|
||
/** | ||
* String utilities for frequent tasks | ||
*/ | ||
class StringUtils | ||
{ | ||
public static function stringify( | ||
mixed $anyValue, | ||
string $arrayConcatChar = ", " | ||
): string { | ||
// this cases are always empty strings | ||
if ($anyValue === null || (is_array($anyValue) && !$anyValue)) { | ||
return ""; | ||
} | ||
if (is_array($anyValue)) { | ||
return implode($arrayConcatChar, $anyValue); | ||
} | ||
return "blub"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?php | ||
|
||
namespace Bug6697; | ||
|
||
$result = \is_subclass_of( '\\My\\Namespace\\MyClass', '\\My\\Namespace\\MyBaseClass', true); |