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