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

PersistenceService   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 71.43%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 49
c 1
b 0
f 0
wmc 6
lcom 0
cbo 0
ccs 15
cts 21
cp 0.7143
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A query() 0 4 1
A getColsOfTable() 0 4 1
A getMetaData() 0 19 1
A existsTable() 0 4 1
A exec() 0 4 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