forked from phpstan/phpstan-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ConstantArrayType - string offset might exist as integer offset
- Loading branch information
1 parent
e5ded04
commit 2fb6632
Showing
4 changed files
with
36 additions
and
9 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
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,25 @@ | ||
<?php | ||
|
||
namespace Bug10577; | ||
|
||
class HelloWorld | ||
{ | ||
private const MAP = [ | ||
'10' => 'Test1', | ||
'20' => 'Test2', | ||
]; | ||
|
||
|
||
public function validate(string $value): void | ||
{ | ||
$value = trim($value); | ||
|
||
if ($value === '') { | ||
throw new \RuntimeException(); | ||
} | ||
|
||
$value = self::MAP[$value] ?? $value; | ||
|
||
// ... | ||
} | ||
} |