aepnat /
simhelpdesk
| 1 | <?php |
||
| 2 | |||
| 3 | class Reports |
||
| 4 | { |
||
| 5 | private $db; |
||
| 6 | |||
| 7 | public function __construct($database) |
||
| 8 | { |
||
| 9 | $this->db = $database; |
||
| 10 | } |
||
| 11 | |||
| 12 | public function data_report($idreport) |
||
|
0 ignored issues
–
show
|
|||
| 13 | { |
||
| 14 | $query = $this->db->prepare('SELECT * FROM `tickets` WHERE `slaid`= ?'); |
||
| 15 | $query->bindValue(1, $slaid); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
| 16 | |||
| 17 | try { |
||
| 18 | $query->execute(); |
||
| 19 | |||
| 20 | return $query->fetch(); |
||
| 21 | } catch (PDOException $e) { |
||
| 22 | die($e->getMessage()); |
||
|
0 ignored issues
–
show
|
|||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | public function data_report_002() |
||
| 27 | { |
||
| 28 | $query = $this->db->prepare('SELECT * FROM `sla` ORDER BY `slaid` ASC'); |
||
| 29 | |||
| 30 | try { |
||
| 31 | $query->execute(); |
||
| 32 | } catch (PDOException $e) { |
||
| 33 | die($e->getMessage()); |
||
|
0 ignored issues
–
show
|
|||
| 34 | } |
||
| 35 | |||
| 36 | return $query->fetchAll(); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.