for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
class Reports
{
private $db;
public function __construct($database)
$this->db = $database;
}
public function data_report($idreport)
$idreport
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function data_report(/** @scrutinizer ignore-unused */ $idreport)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$query = $this->db->prepare('SELECT * FROM `tickets` WHERE `slaid`= ?');
$query->bindValue(1, $slaid);
$slaid
try {
$query->execute();
return $query->fetch();
} catch (PDOException $e) {
die($e->getMessage());
exit
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.
public function data_report_002()
$query = $this->db->prepare('SELECT * FROM `sla` ORDER BY `slaid` ASC');
return $query->fetchAll();
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.