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.

Command::setConnection()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 6
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
namespace Rentgen\Schema;
3
4
use Symfony\Component\EventDispatcher\EventDispatcher;
5
use Rentgen\Database\Connection\Connection;
6
7
abstract class Command
8
{
9
    protected $connection;
10
    protected $dispatcher;
11
12
    /**
13
     * Execute query.
14
     *
15
     * @return integer
16
     */
17
    public function execute()
18
    {
19
        $this->preExecute();
20
        $result = $this->connection->execute($this->getSql());
21
        $this->postExecute();
22
23
        return $result;
24
    }
25
26
    /**
27
     * Set an event dispatcher.
28
     *
29
     * @param EventDispatcher $dispatcher EventDispatcher instance.
30
     *
31
     * @return Command
32
     */
33
    public function setEventDispatcher(EventDispatcher $dispatcher)
34
    {
35
        $this->dispatcher = $dispatcher;
36
37
        return $this;
38
    }
39
40
    /**
41
     * Set the connection.
42
     *
43
     * @param Connection $connection Connection instance.
44
     *
45
     * @return Command
46
     */
47
    public function setConnection(Connection $connection)
48
    {
49
        $this->connection = $connection;
50
51
        return $this;
52
    }
53
54
    /**
55
     * Execute actions before execute query.
56
     *
57
     * @return void
58
     */
59
    protected function preExecute()
60
    {
61
    }
62
63
    /**
64
     * Execute actions after execute query.
65
     *
66
     * @return void
67
     */
68
    protected function postExecute()
69
    {
70
    }
71
72
    /**
73
     * Get sql query to execute.
74
     *
75
     * @return string
76
     */
77
    abstract public function getSql();
78
}
79