forked from CuyZ/Valinor
-
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.
fix: properly handle class/enum name in shaped array key
This commit changes a bit the behaviour of the parser, which is now unable to properly detect missing colon for class constants or enum cases filters — for instance, in `SomeClass:SOME_CONSTANT`, the missing colon was previously detected, now it won't be. This is intentional, because this behaviour would limit the parser's ability to properly parse shaped array keys containing class/enum name. Because this was not such an important feature of the parser, there will be no replacement for it and instead will fix the issue described above.
- Loading branch information
Showing
10 changed files
with
76 additions
and
146 deletions.
There are no files selected for viewing
27 changes: 0 additions & 27 deletions
27
src/Type/Parser/Exception/Constant/MissingClassConstantColon.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace CuyZ\Valinor\Type\Parser\Lexer\Token; | ||
|
||
use CuyZ\Valinor\Utility\IsSingleton; | ||
|
||
/** @internal */ | ||
final class DoubleColonToken implements Token | ||
{ | ||
use IsSingleton; | ||
|
||
public function symbol(): string | ||
{ | ||
return '::'; | ||
} | ||
} |
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,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** @internal */ | ||
enum EnumAtRootNamespace | ||
{ | ||
case FOO; | ||
case BAR; | ||
case BAZ; | ||
} |
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