Issues (10)

src/SqlParser.php (1 issue)

Labels
Severity
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Mysql;
6
7
use Yiisoft\Db\Syntax\AbstractSqlParser;
0 ignored issues
show
The type Yiisoft\Db\Syntax\AbstractSqlParser was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
final class SqlParser extends AbstractSqlParser
10
{
11
    public function getNextPlaceholder(int|null &$position = null): string|null
12
    {
13
        $result = null;
14
        $length = $this->length - 1;
15
16
        while ($this->position < $length) {
17
            $pos = $this->position++;
18
19
            match ($this->sql[$pos]) {
20
                ':' => ($word = $this->parseWord()) === ''
21
                    ? $this->skipChars(':')
22
                    : $result = ':' . $word,
23
                '"', "'", '`' => $this->skipQuotedWithEscape($this->sql[$pos]),
24
                '-' => $this->sql[$this->position] === '-'
25
                    ? ++$this->position && $this->skipToAfterChar("\n")
26
                    : null,
27
                '/' => $this->sql[$this->position] === '*'
28
                    ? ++$this->position && $this->skipToAfterString('*/')
29
                    : null,
30
                default => null,
31
            };
32
33
            if ($result !== null) {
34
                $position = $pos;
35
36
                return $result;
37
            }
38
        }
39
40
        return null;
41
    }
42
}
43