| Total Complexity | 9 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class SuperExpr extends Expr |
||
| 11 | { |
||
| 12 | protected const PDO_TYPES = [PDO::PARAM_INT, PDO::PARAM_STR, PDO::PARAM_BOOL, PDO::PARAM_NULL]; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * SuperExpr constructor. |
||
| 16 | * |
||
| 17 | * @param string|IQueryPart $sql |
||
| 18 | * @param array $params |
||
| 19 | * @param string $super |
||
| 20 | */ |
||
| 21 | public function __construct(string|IQueryPart $sql, array $params = [], string $super = '??') |
||
| 22 | { |
||
| 23 | if ($sql instanceof IQueryPart) { |
||
| 24 | $params = array_merge($params, $sql->getParams()); |
||
| 25 | $sql = (string)$sql; |
||
| 26 | } |
||
| 27 | |||
| 28 | $splitSql = explode($super, $sql); |
||
| 29 | |||
| 30 | $sql = (string)array_shift($splitSql); |
||
| 31 | |||
| 32 | $flatParams = []; |
||
| 33 | foreach ($params as $i => $p) { |
||
| 34 | if (!$this->isParamArray($p)) { |
||
| 35 | $flatParams[] = $p; |
||
| 36 | $sql .= '?'; |
||
| 37 | } else { |
||
| 38 | $flatParams = array_merge($flatParams, $p); |
||
| 39 | $sql .= str_repeat('?, ', count($p) - 1) . '?'; |
||
| 40 | } |
||
| 41 | |||
| 42 | if (isset($splitSql[$i])) { |
||
| 43 | $sql .= $splitSql[$i]; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | parent::__construct($sql, $flatParams); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param null|bool|int|float|string|array $param |
||
| 52 | * |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | protected function isParamArray(null|bool|int|float|string|array $param): bool |
||
| 70 | } |
||
| 71 | } |
||
| 72 |
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