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.

PostAbridge   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

5 Methods

Rating   Name   Duplication   Size   Complexity  
A tableName() 0 4 1
A find() 0 4 1
A behaviors() 0 18 1
A rules() 0 7 1
A transactions() 0 6 1
1
<?php
2
3
namespace tests\models;
4
5
use \omgdef\multilingual\MultilingualBehavior;
6
use \omgdef\multilingual\MultilingualQuery;
7
8
/**
9
 * Post
10
 *
11
 * @property integer $id
12
 * @property string $title
13
 * @property string $body
14
 *
15
 */
16
class PostAbridge extends \yii\db\ActiveRecord
17
{
18
    /**
19
     * @inheritdoc
20
     */
21
    public static function tableName()
22
    {
23
        return 'post';
24
    }
25
26
    /**
27
     * @inheritdoc
28
     */
29
    public function behaviors()
30
    {
31
        return [
32
            'ml' => [
33
                'class' => MultilingualBehavior::className(),
34
                'languages' => [
35
                    'ru' => 'Russian',
36
                    'en-US' => 'English',
37
                ],
38
                'defaultLanguage' => 'ru',
39
                'langForeignKey' => 'post_id',
40
                'tableName' => "{{%postLang}}",
41
                'attributes' => [
42
                    'title', 'body',
43
                ]
44
            ],
45
        ];
46
    }
47
48
    /**
49
     * @inheritdoc
50
     */
51
    public function rules()
52
    {
53
        return [
54
            [['title', 'body'], 'required'],
55
            ['title', 'string'],
56
        ];
57
    }
58
59
    /**
60
     * @inheritdoc
61
     */
62
    public function transactions()
63
    {
64
        return [
65
            self::SCENARIO_DEFAULT => self::OP_ALL,
66
        ];
67
    }
68
69
    /**
70
     * @inheritdoc
71
     */
72
    public static function find()
73
    {
74
        return new MultilingualQuery(get_called_class());
75
    }
76
}