PredisThrottleTest::setUpBeforeClass()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
nc 2
nop 0
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