DoctrineDbalAdapter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 15
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A escape() 0 4 1
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace Puzzle\QueryBuilder\Escapers;
6
7
use Puzzle\QueryBuilder\Escaper;
8
use Doctrine\DBAL\Driver\Connection;
9
10
class DoctrineDbalAdapter implements Escaper
11
{
12
    private
13
        $db;
1 ignored issue
show
Coding Style introduced by
The visibility should be declared for property $db.

The PSR-2 coding standard requires that all properties in a class have their visibility explicitly declared. If you declare a property using

class A {
    var $property;
}

the property is implicitly global.

To learn more about the PSR-2, please see the PHP-FIG site on the PSR-2.

Loading history...
14
15
    public function __construct(Connection $db)
16
    {
17
        $this->db = $db;
18
    }
19
20
    public function escape($value)
21
    {
22
        return $this->db->quote($value);
23
    }
24
}
25