Completed
Push — master ( c1fce6...6de931 )
by Alexey
02:42
created

Module::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace api\modules\v1;
4
5
use Yii;
6
use yii\filters\RateLimiter;
7
use api\components\IpLimiter;
8
9
/**
10
 * Class Module
11
 * @package api\modules\v1
12
 */
13
class Module extends \yii\base\Module
14
{
15
    /**
16
     * @inheritdoc
17
     */
18
    public $controllerNamespace = 'api\modules\v1\controllers';
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function behaviors()
24
    {
25
        return [
26
            'rateLimiter' => [
27
                'class' => RateLimiter::class,
28
                'user' => new IpLimiter(),
29
                'enableRateLimitHeaders' => true,
30
                'errorMessage' => Yii::t('app', 'Exceeded the limit of applications!')
31
            ]
32
        ];
33
    }
34
}
35