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.

Rentgen   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 5
Bugs 1 Features 3
Metric Value
wmc 6
c 5
b 1
f 3
lcom 0
cbo 2
dl 0
loc 79
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
A get() 0 4 1
A createManipulationInstance() 0 4 1
A createInfoInstance() 0 4 1
A execute() 0 6 1
A query() 0 6 1
1
<?php
2
3
namespace Rentgen;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
7
use Rentgen\DependencyInjection\RentgenExtension;
8
use Rentgen\Schema\Info;
9
use Rentgen\Schema\Manipulation;
10
11
class Rentgen
12
{
13
    private $container;
14
15
    /**
16
     * Constructor.
17
     */
18
    public function __construct()
19
    {
20
        $container = new ContainerBuilder();
21
22
        $extension = new RentgenExtension();
23
        $container->registerExtension($extension);
24
        $container->loadFromExtension($extension->getAlias());
25
        $container->compile();
26
27
        $this->container = $container;
28
    }
29
30
    /**
31
     * Get a service.
32
     *
33
     * @param string $service A service name.
34
     *
35
     * @return mixed
36
     */
37
    public function get($service)
38
    {
39
        return $this->container->get($service);
40
    }
41
42
    /**
43
     * Create the manipulation instance.
44
     *
45
     * @return Rentgen\Schema\Manipulation
46
     */
47
    public function createManipulationInstance()
48
    {
49
        return $this->container->get('rentgen.schema.manipulation');
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->container->get('r....schema.manipulation'); of type object|null adds the type object to the return on line 49 which is incompatible with the return type documented by Rentgen\Rentgen::createManipulationInstance of type Rentgen\Rentgen\Schema\Manipulation|null.
Loading history...
50
    }
51
52
    /**
53
     * Create the info instance.
54
     *
55
     * @return Rentgen\Schema\Info
56
     */
57
    public function createInfoInstance()
58
    {
59
        return $this->container->get('rentgen.schema.info');
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->container->get('rentgen.schema.info'); of type object|null adds the type object to the return on line 59 which is incompatible with the return type documented by Rentgen\Rentgen::createInfoInstance of type Rentgen\Rentgen\Schema\Info|null.
Loading history...
60
    }
61
62
    /**
63
     * Execute sql query.
64
     *
65
     * @param string $sql A sql query.
66
     *
67
     * @return integer
68
     */
69
    public function execute($sql)
70
    {
71
        $connection = $this->get('connection');
72
73
        return $connection->execute($sql);
74
    }
75
76
     /**
77
     * Execute sql query with select intention.
78
     *
79
     * @param string $sql A sql query.
80
     *
81
     * @return array
82
     */
83
    public function query($sql)
84
    {
85
        $connection = $this->get('connection');
86
87
        return $connection->query($sql);
88
    }
89
}
90