Completed
Pull Request — master (#1)
by Nielsen
05:53 queued 02:22
created

PersistenceService::existsTable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
c 1
b 0
f 0
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Softbox\Persistence\Core\SQL;
4
5
class PersistenceService
6
{
7
    /**
8
     * PersistenceService constructor.
9
     */
10 10
    public function __construct()
11
    {
12 10
    }
13
14
    public function query($sql, $params = [])
0 ignored issues
show
Unused Code introduced by
The parameter $sql is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $params is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
15
    {
16
        return [];
17
    }
18
19
    public function getColsOfTable($tableName)
20
    {
21
        return array_keys($this->getMetaData($tableName));
22
    }
23
24 1
    public function getMetaData($table)
0 ignored issues
show
Unused Code introduced by
The parameter $table is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
25
    {
26
        return [
27
            "a" => [
28 1
                "size" => 10,
29 1
                "type" => "int",
30 1
            ],
31
32
            "b" => [
33 1
                "size" => 10,
34 1
                "type" => "varchar",
35 1
            ],
36
37
            "c" => [
38 1
                "size" => 10,
39 1
                "type" => "varchar",
40 1
            ],
41 1
        ];
42
    }
43
44 1
    public function existsTable($tableName)
45
    {
46 1
        return $tableName === 'teste';
47
    }
48
49
    public function exec($sql, $values = [])
0 ignored issues
show
Unused Code introduced by
The parameter $sql is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
50
    {
51
        return $values;
52
    }
53
}
54