PredisThrottleTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 15
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setUpBeforeClass() 0 4 2
A createConnection() 0 6 1
1
<?php
2
3
namespace Zenstruck\Governator\Tests\Integration\Redis;
4
5
/**
6
 * @group time-sensitive
7
 *
8
 * @author Kevin Bond <[email protected]>
9
 */
10
final class PredisThrottleTest extends BaseRedisThrottleTest
11
{
12
    public static function setUpBeforeClass(): void
13
    {
14
        if (!\getenv('REDIS_HOST')) {
15
            self::markTestSkipped('REDIS_HOST not configured.');
16
        }
17
    }
18
19
    protected function createConnection(): object
20
    {
21
        $redis = new \Predis\Client('tcp://'.\getenv('REDIS_HOST').':6379');
22
        $redis->connect();
23
24
        return $redis;
25
    }
26
}
27