yiisoft /
db-oracle
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace Yiisoft\Db\Oracle; |
||
| 6 | |||
| 7 | use Yiisoft\Db\Syntax\AbstractSqlParser; |
||
|
0 ignored issues
–
show
|
|||
| 8 | |||
| 9 | final class SqlParser extends AbstractSqlParser |
||
| 10 | { |
||
| 11 | 36 | public function getNextPlaceholder(int|null &$position = null): string|null |
|
| 12 | { |
||
| 13 | 36 | $result = null; |
|
| 14 | 36 | $length = $this->length - 1; |
|
| 15 | |||
| 16 | 36 | while ($this->position < $length) { |
|
| 17 | 36 | $pos = $this->position++; |
|
| 18 | |||
| 19 | 36 | match ($this->sql[$pos]) { |
|
| 20 | 36 | ':' => ($word = $this->parseWord()) === '' |
|
| 21 | 1 | ? $this->skipChars(':') |
|
| 22 | 35 | : $result = ':' . $word, |
|
| 23 | 36 | '"' => $this->skipToAfterChar('"'), |
|
| 24 | 36 | "'" => $this->skipQuotedWithoutEscape($this->sql[$pos]), |
|
| 25 | 36 | 'q', 'Q' => $this->sql[$this->position] === "'" |
|
| 26 | 4 | ? $this->skipQuotedWithQ() |
|
|
0 ignored issues
–
show
Are you sure the usage of
$this->skipQuotedWithQ() targeting Yiisoft\Db\Oracle\SqlParser::skipQuotedWithQ() seems to always return null.
This check looks for function or method calls that always return null and whose return value is used. class A
{
function getObject()
{
return null;
}
}
$a = new A();
if ($a->getObject()) {
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes. Loading history...
|
|||
| 27 | 4 | : null, |
|
| 28 | 36 | '-' => $this->sql[$this->position] === '-' |
|
| 29 | 1 | ? ++$this->position && $this->skipToAfterChar("\n") |
|
| 30 | 1 | : null, |
|
| 31 | 36 | '/' => $this->sql[$this->position] === '*' |
|
| 32 | 1 | ? ++$this->position && $this->skipToAfterString('*/') |
|
| 33 | 1 | : null, |
|
| 34 | 36 | default => null, |
|
| 35 | 36 | }; |
|
| 36 | |||
| 37 | 36 | if ($result !== null) { |
|
| 38 | 34 | $position = $pos; |
|
| 39 | |||
| 40 | 34 | return $result; |
|
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | 8 | return null; |
|
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Skips quoted string with Q-operator. |
||
| 49 | */ |
||
| 50 | 4 | private function skipQuotedWithQ(): void |
|
| 51 | { |
||
| 52 | 4 | $endChar = match ($this->sql[++$this->position]) { |
|
| 53 | 4 | '[' => ']', |
|
| 54 | 4 | '<' => '>', |
|
| 55 | 4 | '{' => '}', |
|
| 56 | 4 | '(' => ')', |
|
| 57 | 4 | default => $this->sql[$this->position], |
|
| 58 | 4 | }; |
|
| 59 | |||
| 60 | 4 | ++$this->position; |
|
| 61 | |||
| 62 | 4 | $this->skipToAfterString("$endChar'"); |
|
| 63 | } |
||
| 64 | } |
||
| 65 |
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths