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 ( 951ad1...29ba67 )
by Alexey
08:55
created

BaseDaoBehavior::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * @author Alexey Tatarinov <[email protected]>
4
 * @link https://github.com/shogodev/argilla/
5
 * @copyright Copyright &copy; 2003-2016 Shogo
6
 * @license http://argilla.ru/LICENSE
7
 */
8
class BaseDaoBehavior extends SBehavior
9
{
10
  const VARIANT_TABLE = '{{product_param_variant}}';
11
12
  const PARAMETER_NAME_TABLE = '{{product_param_name}}';
13
14
  const PARAMETER_TABLE = '{{product_param}}';
15
16
  const PRODUCT_TABLE = '{{product}}';
17
18
  /**
19
   * @var CDbCommandBuilder $builder
20
   */
21
  protected $builder;
22
23
  public function init()
24
  {
25
    parent::init();
26
27
    $this->builder = new CDbCommandBuilder(Yii::app()->db->getSchema());
28
  }
29
30
  /**
31
   * @param array $array
32
   * @param string $index
33
   *
34
   * @return array
35
   */
36
  protected function indexData(array $array, $index)
37
  {
38
    if( is_null($index) )
39
      return $array;
40
41
    $indexedData = array();
42
    foreach($array as $data)
43
    {
44
      $indexedData[$data[$index]] = $data;
45
    }
46
47
    return $indexedData;
48
  }
49
}