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.

Factory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 23
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A datasourceFromDbConnection() 0 15 3
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: wechsler
5
 * Date: 04/10/15
6
 * Time: 21:05
7
 */
8
9
namespace Phase\TakeATicket\DataSource;
10
11
use Doctrine\DBAL\Connection;
12
13
class Factory
14
{
15
    /**
16
     * @param Connection $connection
17
     *
18
     * @return AbstractSql
19
     */
20
    public static function datasourceFromDbConnection(Connection $connection)
21
    {
22
        $driverType = $connection->getDriver()->getName();
23
24
        switch ($driverType) {
25
            case 'pdo_mysql':
26
                return new MySql($connection);
27
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
28
            case 'pdo_sqlite':
29
                return new Sqlite($connection);
30
                break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
31
            default:
32
                throw new \InvalidArgumentException("Can't use Db of type $driverType");
33
        }
34
    }
35
}
36