Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
bendavies authored and norberttech committed Apr 12, 2016
1 parent 1e70e5c commit a48618c
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,22 @@ protected function getNonCatchablePatterns()
*/
protected function getType(&$value)
{
switch($value) {
case ')':
return self::T_CLOSE_PARENTHESIS;
case '{':
return self::T_OPEN_CURLY_BRACE;
case '}':
return self::T_CLOSE_CURLY_BRACE;
case ':':
return self::T_COLON;
case ',':
return self::T_COMMA;
default:
$type = self::T_NONE;
break;
$type = self::T_NONE;

if (')' === $value) {
return self::T_CLOSE_PARENTHESIS;
}
if ('{' === $value) {
return self::T_OPEN_CURLY_BRACE;
}
if ('}' === $value) {
return self::T_CLOSE_CURLY_BRACE;
}
if (':' === $value) {
return self::T_COLON;
}
if (',' === $value) {
return self::T_COMMA;
}

if ($this->isTypePatternToken($value)) {
Expand Down

0 comments on commit a48618c

Please sign in to comment.