TubePlaceholderResolver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A resolve() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
/**
4
 * This file is part of the tarantool/queue package.
5
 *
6
 * (c) Eugene Leonovich <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Tarantool\Queue\Tests\Integration;
15
16
use PHPUnitExtras\Annotation\PlaceholderResolver\PlaceholderResolver;
17
use PHPUnitExtras\Annotation\Target;
18
19
final class TubePlaceholderResolver implements PlaceholderResolver
20
{
21
    private $testCase;
22
23
    public function __construct(TestCase $testCase)
24
    {
25
        $this->testCase = $testCase;
26
    }
27
28
    public function getName() : string
29
    {
30
        return 'tube';
31
    }
32
33
    public function resolve(string $value, Target $target) : string
34
    {
35
        return strtr($value, [
36
            '%tube_name%' => $this->testCase->getQueueName(),
37
            '%tube_type%' => $this->testCase->getQueueType(),
38
        ]);
39
    }
40
}
41