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 ( c33231...af10c0 )
by Pavel
18:25 queued 12:21
created

ArrayDataSet::__construct()   B

Complexity

Conditions 5
Paths 7

Size

Total Lines 20
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 15
CRAP Score 5.0407

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 20
ccs 15
cts 17
cp 0.8824
rs 8.8571
cc 5
eloc 13
nc 7
nop 1
crap 5.0407
1
<?php
2
/**
3
 * @link https://github.com/paulzi/yii2-materialized-path
4
 * @copyright Copyright (c) 2015 PaulZi <[email protected]>
5
 * @license MIT (https://github.com/paulzi/yii2-materialized-path/blob/master/LICENSE)
6
 */
7
8
namespace paulzi\materializedpath\tests;
9
10
/**
11
 * @author PaulZi <[email protected]>
12
 */
13
class ArrayDataSet extends \PHPUnit_Extensions_Database_DataSet_ArrayDataSet
14
{
15 93
    public function __construct(array $data)
16
    {
17 93
        foreach ($data as $tableName => $rows) {
18 93
            $columns = array();
19 93
            if (isset($rows['columns'])) {
20
                $columns = $rows['columns'];
21
                unset($rows['columns']);
22 93
            } elseif (isset($rows[0])) {
23 93
                $columns = array_keys($rows[0]);
24 93
            }
25
26 93
            $metaData = new \PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($tableName, $columns);
27 93
            $table    = new \PHPUnit_Extensions_Database_DataSet_DefaultTable($metaData);
28
29 93
            foreach ($rows AS $row) {
30 93
                $table->addRow($row);
31 93
            }
32 93
            $this->tables[$tableName] = $table;
33 93
        }
34
    }
35
}