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

BCommonAssociationBehavior   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 3
dl 0
loc 17
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 5 2
A afterDelete() 0 6 1
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 24 and the first side effect is on line 18.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * @author Alexey Tatarinov <[email protected]>
4
 * @link https://github.com/shogodev/argilla/
5
 * @copyright Copyright &copy; 2003-2014 Shogo
6
 * @license http://argilla.ru/LICENSE
7
 *
8
 * public function behaviors()
9
 * {
10
 *   return array(
11
 *     'commonAssociationBehavior' => array(
12
 *       'class' => 'backend.modules.commonAssociation.models.BCommonAssociationBehavior',
13
 *       'associationGroup' => 'color'
14
 *     ),
15
 *   );
16
 * }
17
 */
18
Yii::import('backend.modules.commonAssociation.models.BCommonAssociation');
19
/**
20
 * Class BCommonAssociationBehavior
21
 *
22
 * @property BActiveRecord $owner
23
 */
24
class BCommonAssociationBehavior extends SActiveRecordBehavior
25
{
26
  public $associationGroup;
27
28
  public function init()
29
  {
30
    if( empty($this->associationGroup) )
31
      throw new RequiredPropertiesException(__CLASS__, 'associationGroup');
32
  }
33
34
  public function afterDelete($event)
35
  {
36
    parent::afterDelete($event);
37
38
    BCommonAssociation::model()->clear($this->associationGroup);
39
  }
40
}