Skip to content

Commit 6b2a6c3

Browse files
committed
Use instanceof instead of getclass
Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent 53316e3 commit 6b2a6c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Statement.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function parse(Parser $parser, TokensList $list)
255255
// ON DUPLICATE KEY UPDATE ...
256256
// has to be parsed in parent statement (INSERT or REPLACE)
257257
// so look for it and break
258-
if (get_class($this) === 'PhpMyAdmin\SqlParser\Statements\SelectStatement'
258+
if ($this instanceof \PhpMyAdmin\SqlParser\Statements\SelectStatement
259259
&& $token->value === 'ON'
260260
) {
261261
++$list->idx; // Skip ON
@@ -351,7 +351,7 @@ public function parse(Parser $parser, TokensList $list)
351351
} elseif ($class === null) {
352352
// Handle special end options in Select statement
353353
// See Statements\SelectStatement::$END_OPTIONS
354-
if (get_class($this) === 'PhpMyAdmin\SqlParser\Statements\SelectStatement'
354+
if ($this instanceof \PhpMyAdmin\SqlParser\Statements\SelectStatement
355355
&& ($token->value === 'FOR UPDATE'
356356
|| $token->value === 'LOCK IN SHARE MODE')
357357
) {

0 commit comments

Comments
 (0)