Total Complexity | 4 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class RewriteMap |
||
12 | { |
||
13 | /** @var string */ |
||
14 | private $rewriteMapFileContent; |
||
15 | /** |
||
16 | * @var int |
||
17 | */ |
||
18 | private $storeId; |
||
19 | /** |
||
20 | * @var int |
||
21 | */ |
||
22 | private $redirectType; |
||
23 | |||
24 | 7 | public function __construct(int $storeId, int $redirectType) |
|
25 | { |
||
26 | 7 | $this->rewriteMapFileContent = ''; |
|
27 | 7 | $this->storeId = $storeId; |
|
28 | 7 | $this->redirectType = $redirectType; |
|
29 | 7 | } |
|
30 | |||
31 | 3 | public function addRewrite(string $request, string $target) |
|
32 | { |
||
33 | 3 | $this->rewriteMapFileContent .= sprintf("/%s /%s\n", $request, $target); |
|
34 | 3 | } |
|
35 | |||
36 | 5 | public function getFilename(): string |
|
39 | } |
||
40 | |||
41 | 3 | public function getContent(): string |
|
44 | } |
||
45 | } |
||
46 |