| Total Complexity | 6 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 9 | class Insight |
||
| 10 | { |
||
| 11 | /** @var wpdb */ |
||
| 12 | protected $db; |
||
| 13 | |||
| 14 | /** @var string */ |
||
| 15 | protected $table; |
||
| 16 | |||
| 17 | public function __construct(?wpdb $db = null) |
||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Get all rows from the insight table. |
||
| 26 | */ |
||
| 27 | public function all(): array |
||
| 28 | { |
||
| 29 | $sql = "SELECT * FROM {$this->table}"; |
||
| 30 | return $this->db->get_results($sql, ARRAY_A); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Count rows in the insight table. |
||
| 35 | */ |
||
| 36 | public function count(): int |
||
| 37 | { |
||
| 38 | $sql = "SELECT COUNT(*) FROM {$this->table}"; |
||
| 39 | return (int) $this->db->get_var($sql); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Insert an insight row. |
||
| 44 | */ |
||
| 45 | public function insert(string $item, string $remark, int $id): bool |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Update remark value by row id. |
||
| 57 | */ |
||
| 58 | public function updateRemark(int $id, string $remark): int |
||
| 69 |
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