| Conditions | 9 |
| Paths | 12 |
| Total Lines | 23 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | protected function assertPostTypeOnQuery(WP_Query $query, string $postType): self |
||
| 30 | { |
||
| 31 | $actual = $query->get('post_type', null); |
||
| 32 | |||
| 33 | if (is_array($actual) && count($actual) === 1) { |
||
| 34 | $actual = $actual[0]; |
||
| 35 | } elseif (!is_string($actual)) { |
||
| 36 | $actual = null; |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($postType !== $actual) { |
||
| 40 | if (is_string($actual) || $actual instanceof Stringable) { |
||
| 41 | $message = "Query post_type value must be \"{$postType}\", but it is \"{$actual}\"."; |
||
| 42 | } elseif (is_array($actual) && in_array($postType, $actual, true)) { |
||
| 43 | $message = "post_type value for query must be exclusively for \"{$postType}\"."; |
||
| 44 | } else { |
||
| 45 | $message = "Query post_type value must be \"{$postType}\"."; |
||
| 46 | } |
||
| 47 | |||
| 48 | throw new InvalidArgumentException($message); |
||
| 49 | } |
||
| 50 | |||
| 51 | return $this; |
||
| 52 | } |
||
| 54 |
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