File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -56,20 +56,22 @@ protected function getNonCatchablePatterns()
56
56
*/
57
57
protected function getType (&$ value )
58
58
{
59
- switch ($ value ) {
60
- case ') ' :
61
- return self ::T_CLOSE_PARENTHESIS ;
62
- case '{ ' :
63
- return self ::T_OPEN_CURLY_BRACE ;
64
- case '} ' :
65
- return self ::T_CLOSE_CURLY_BRACE ;
66
- case ': ' :
67
- return self ::T_COLON ;
68
- case ', ' :
69
- return self ::T_COMMA ;
70
- default :
71
- $ type = self ::T_NONE ;
72
- break ;
59
+ $ type = self ::T_NONE ;
60
+
61
+ if (') ' === $ value ) {
62
+ return self ::T_CLOSE_PARENTHESIS ;
63
+ }
64
+ if ('{ ' === $ value ) {
65
+ return self ::T_OPEN_CURLY_BRACE ;
66
+ }
67
+ if ('} ' === $ value ) {
68
+ return self ::T_CLOSE_CURLY_BRACE ;
69
+ }
70
+ if (': ' === $ value ) {
71
+ return self ::T_COLON ;
72
+ }
73
+ if (', ' === $ value ) {
74
+ return self ::T_COMMA ;
73
75
}
74
76
75
77
if ($ this ->isTypePatternToken ($ value )) {
You can’t perform that action at this time.
0 commit comments