1 | <?php |
||
2 | namespace RazonYang\Yii2\RateLimiter\Redis; |
||
3 | |||
4 | use yii\di\Instance; |
||
5 | use yii\redis\Connection; |
||
6 | use RazonYang\TokenBucket\ManagerInterface; |
||
7 | use RazonYang\Yii2\RateLimiter\BaseRateLimiter; |
||
8 | |||
9 | class RateLimiter extends BaseRateLimiter |
||
10 | { |
||
11 | /** |
||
12 | * @var Connectioin |
||
0 ignored issues
–
show
|
|||
13 | */ |
||
14 | public $redis = 'redis'; |
||
15 | |||
16 | public $ttl = 3600; |
||
17 | |||
18 | public $prefix = 'rate_limiter:'; |
||
19 | |||
20 | 2 | public function init() |
|
21 | { |
||
22 | 2 | $this->redis = Instance::ensure($this->redis, Connection::class); |
|
23 | |||
24 | 2 | parent::init(); |
|
25 | 2 | } |
|
26 | |||
27 | 2 | protected function initManager(): ManagerInterface |
|
28 | { |
||
29 | 2 | return new Manager($this->capacity, $this->rate, $this->getLogger(), $this->redis, $this->ttl, $this->prefix); |
|
30 | } |
||
31 | } |
||
32 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths