GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 21cf6c...173932 )
by Benjamin
03:31 queued 48s
created

PDOConnection   A

Complexity

Total Complexity 17

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 36
dl 0
loc 93
ccs 0
cts 40
cp 0
rs 10
c 0
b 0
f 0
wmc 17

7 Methods

Rating   Name   Duplication   Size   Complexity  
A beginTransaction() 0 6 2
A lastInsertId() 0 6 2
A exec() 0 6 2
A rollBack() 0 6 2
A query() 0 16 5
A prepare() 0 6 2
A commit() 0 6 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: benjamin
5
 * Date: 13/01/19
6
 * Time: 22:49
7
 */
8
9
namespace Lib\DB\DBAL\Connection;
10
11
use Lib\DB\DBAL\FetchMode;
12
use PDO;
13
14
class PDOConnection extends PDO implements ConnectionInterface
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public function prepare($prepareString, $driverOptions = null)
20
    {
21
        try {
22
            parent::prepare($prepareString, $driverOptions);
23
        } catch (\PDOException $e) {
24
            throw new \PDOException($e);
25
        }
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function query($query, $mode = FetchMode::DEFAULT, $arg3 = null, array $ctorargs = [])
32
    {
33
        $argsCount = \count(func_get_args());
34
        try {
35
            if ($argsCount === 4) {
36
                return parent::query($query, $mode, $arg3, $ctorargs);
37
            }
38
            if ($argsCount === 3) {
39
                return parent::query($query, $mode, $arg3);
40
            }
41
            if ($argsCount === 2) {
42
                return parent::query($query, $mode);
43
            }
44
            return parent::query($query);
45
        } catch (\PDOException $e) {
46
            throw new \PDOException($e);
47
        }
48
    }
49
50
    /**
51
     * {@inheritdoc}
52
     */
53
    public function exec($statement)
54
    {
55
        try {
56
            parent::exec($statement);
57
        } catch (\PDOException $e) {
58
            throw new \PDOException($e);
59
        }
60
    }
61
62
    /**
63
     * {@inheritdoc}
64
     */
65
    public function lastInsertId($name = null)
66
    {
67
        try {
68
            parent::lastInsertId($name);
69
        } catch (\PDOException $e) {
70
            throw new \PDOException($e);
71
        }
72
    }
73
74
    /**
75
     * {@inheritdoc}
76
     */
77
    public function beginTransaction()
78
    {
79
        try {
80
            parent::beginTransaction();
81
        } catch (\PDOException $e) {
82
            throw new \PDOException($e);
83
        }
84
    }
85
86
    /**
87
     * {@inheritdoc}
88
     */
89
    public function commit()
90
    {
91
        try {
92
            parent::commit();
93
        } catch (\PDOException $e) {
94
            throw new \PDOException($e);
95
        }
96
    }
97
98
    /**
99
     * {@inheritdoc}
100
     */
101
    public function rollBack()
102
    {
103
        try {
104
            parent::rollBack();
105
        } catch (\PDOException $e) {
106
            throw new \PDOException($e);
107
        }
108
    }
109
}
110