| Conditions | 10 |
| Paths | 3 |
| Total Lines | 34 |
| Code Lines | 24 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 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->skipQuotedWithoutEscape($this->sql[$pos]), |
||
| 24 | 'e', 'E' => $this->sql[$this->position] === "'" |
||
| 25 | ? ++$this->position && $this->skipQuotedWithEscape("'") |
||
| 26 | : null, |
||
| 27 | '$' => $this->skipQuotedWithDollar(), |
||
| 28 | '-' => $this->sql[$this->position] === '-' |
||
| 29 | ? ++$this->position && $this->skipToAfterChar("\n") |
||
| 30 | : null, |
||
| 31 | '/' => $this->sql[$this->position] === '*' |
||
| 32 | ? ++$this->position && $this->skipToAfterString('*/') |
||
| 33 | : null, |
||
| 34 | default => null, |
||
| 35 | }; |
||
| 36 | |||
| 37 | if ($result !== null) { |
||
| 38 | $position = $pos; |
||
| 39 | |||
| 40 | return $result; |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | return null; |
||
| 45 | } |
||
| 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