TubePlaceholderResolver::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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