for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace DataSource\TableDataGateway;
use DataSource\Connection;
use BasePatterns\RecordSet\RecordSet;
use Infrastructure\Database\DbDataAdapter;
class DataSetHolder
{
public RecordSet $data;
private array $dataAdapters = [];
private Connection $connection;
public function __construct(Connection $connection)
$this->connection = $connection;
$this->data = new RecordSet();
}
public function fillData(
string $query,
string $tableName,
array $params = []
$params
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
/** @scrutinizer ignore-unused */ array $params = []
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
): void {
if (array_key_exists($tableName, $this->dataAdapters)) {
throw new MultipleLoadException();
$da = new DbDataAdapter($query, $this->connection);
$da->fill($this->data, $tableName);
$this->dataAdapters[$tableName] = $da;
public function update(): void
foreach ($this->dataAdapters as $table => $da) {
$da->update($this->data, $table);
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.