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.

Connection   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 7
lcom 0
cbo 4
dl 0
loc 79
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 18 3
A table() 0 6 1
A getConnection() 0 4 1
A getElapsedTime() 0 4 1
A getSchemaBuilder() 0 4 1
1
<?php
2
3
namespace duxet\Rethinkdb;
4
5
use duxet\Rethinkdb\Query\Builder as QueryBuilder;
6
use duxet\Rethinkdb\Schema\Grammar;
7
use r;
8
9
class Connection extends \Illuminate\Database\Connection
10
{
11
    /**
12
     * The RethinkDB connection handler.
13
     *
14
     * @var r\Connection
15
     */
16
    protected $connection;
17
18
    /**
19
     * Create a new database connection instance.
20
     *
21
     * @param array $config
22
     */
23
    public function __construct(array $config)
24
    {
25
        $this->config = $config;
26
        $this->database = $config['database'];
27
28
        $port = isset($config['port']) ? $config['port'] : 28015;
29
        $authKey = isset($config['authKey']) ? $config['authKey'] : null;
30
31
        // Create the connection
32
        $this->connection = r\connect($config['host'], $port, $this->database, $authKey);
33
34
        // We need to initialize a query grammar and the query post processors,
35
        // which are both very important parts of the database abstractions -
36
        // so we initialize these to their default values when starting.
37
        $this->useDefaultQueryGrammar();
38
        $this->useDefaultPostProcessor();
39
        $this->schemaGrammar = new Grammar();
40
    }
41
42
    /**
43
     * Begin a fluent query against a database table.
44
     *
45
     * @param string $table
46
     *
47
     * @return QueryBuilder
48
     */
49
    public function table($table)
50
    {
51
        $query = new QueryBuilder($this);
52
53
        return $query->from($table);
54
    }
55
56
    /**
57
     * Get a RethinkDB connection.
58
     *
59
     * @return \r\Connection
60
     */
61
    public function getConnection()
62
    {
63
        return $this->connection;
64
    }
65
66
    /**
67
     * Get the elapsed time since a given starting point.
68
     *
69
     * @param int $start
70
     *
71
     * @return float
72
     */
73
    public function getElapsedTime($start)
74
    {
75
        return parent::getElapsedTime($start);
76
    }
77
78
    /**
79
     * Get a schema builder instance for the connection.
80
     *
81
     * @return Schema\Builder
82
     */
83
    public function getSchemaBuilder()
84
    {
85
        return new Schema\Builder($this);
86
    }
87
}
88