Skip to content

Commit d5cf665

Browse files
committed
Improve variable and flow documentation. Simplify condition
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
1 parent 91343d2 commit d5cf665

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

‎src/Components/JoinKeyword.php‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ class JoinKeyword extends Component
6262
* @var Condition[]
6363
*/
6464
public $on;
65+
/**
66+
* Columns in Using clause
67+
*
68+
* @var ArrayObj
69+
*/
6570
public $using;
6671

6772
/**
@@ -86,7 +91,8 @@ public static function parse(Parser $parser, TokensList $list, array $options =
8691
*
8792
* 1 -----------------------[ expr ]----------------------> 2
8893
*
89-
* 2 ---------------------[ ON|USING ]--------------------> 3/4
94+
* 2 ------------------------[ ON ]-----------------------> 3
95+
* 2 -----------------------[ USING ]---------------------> 4
9096
*
9197
* 3 --------------------[ conditions ]-------------------> 0
9298
*
@@ -134,8 +140,12 @@ public static function parse(Parser $parser, TokensList $list, array $options =
134140
$expr->expr = Expression::parse($parser, $list, array('field' => 'table'));
135141
$state = 2;
136142
} elseif ($state === 2) {
137-
if (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'ON' || $token->value === 'USING')) {
138-
$state = $token->value === 'ON' ? 3 : 4;
143+
if ($token->type === Token::TYPE_KEYWORD) {
144+
if ($token->value === 'ON') {
145+
$state = 3;
146+
} elseif ($token->value === 'USING') {
147+
$state = 4;
148+
}
139149
}
140150
} elseif ($state === 3) {
141151
$expr->on = Condition::parse($parser, $list);

0 commit comments

Comments
 (0)