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.

ArrayDataSet   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 3
dl 0
loc 23
ccs 12
cts 14
cp 0.8571
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 20 5
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 96
    public function __construct(array $data)
16
    {
17 96
        foreach ($data as $tableName => $rows) {
18 96
            $columns = array();
19 96
            if (isset($rows['columns'])) {
20
                $columns = $rows['columns'];
21
                unset($rows['columns']);
22 96
            } elseif (isset($rows[0])) {
23 96
                $columns = array_keys($rows[0]);
24
            }
25
26 96
            $metaData = new \PHPUnit_Extensions_Database_DataSet_DefaultTableMetaData($tableName, $columns);
27 96
            $table    = new \PHPUnit_Extensions_Database_DataSet_DefaultTable($metaData);
28
29 96
            foreach ($rows AS $row) {
30 96
                $table->addRow($row);
31
            }
32 96
            $this->tables[$tableName] = $table;
33
        }
34
    }
35
}