for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Basis;
use ClickHouseDB\Client;
class Clickhouse
{
use Toolkit;
public $bucketSize = 1000;
public function select($fields, string $table, array $params = [])
if (is_array($fields)) {
$fields = implode(', ', $fields);
}
$query = "SELECT $fields FROM $table";
$binds = [];
if (count($params)) {
$where = [];
foreach ($params as $k => $v) {
$binds[$k] = (array) $v;
$where[] = $k.' in (:'.$k.')';
$where = implode(' and ', $where);
$query .= " where $where";
return $this->get(Client::class)->select($query, $binds);
public function insert(string $table, array $data, array $headers)
$table
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$client = $this->get(Client::class);
if (count($data) < $this->bucketSize) {
$buckets = [$data];
} else {
$buckets = array_chunk($data, $this->bucketSize);
foreach ($buckets as $bucket) {
$client->insert('tester', $bucket, $headers);
return count($buckets);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.