Reports::data_report_002()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 6
c 1
b 1
f 0
nc 2
nop 0
dl 0
loc 11
rs 10
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
Unused Code introduced by
The parameter $idreport is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

12
    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.

Loading history...
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
The variable $slaid seems to be never defined.
Loading history...
16
17
        try {
18
            $query->execute();
19
20
            return $query->fetch();
21
        } catch (PDOException $e) {
22
            die($e->getMessage());
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
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
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
34
        }
35
36
        return $query->fetchAll();
37
    }
38
}
39