| Total Complexity | 7 |
| Total Lines | 47 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 10 | class MockSnippetFile extends AbstractSnippetFile |
||
| 11 | { |
||
| 12 | private string $name; |
||
| 13 | |||
| 14 | private bool $isBase; |
||
| 15 | |||
| 16 | private string $iso; |
||
| 17 | |||
| 18 | private string $technicalName; |
||
| 19 | |||
| 20 | public function __construct(string $name, ?string $iso = null, string $content = '{}', bool $isBase = true, string $technicalName = 'mock') |
||
| 21 | { |
||
| 22 | $this->name = $name; |
||
| 23 | $this->iso = $iso ?? $name; |
||
| 24 | $this->isBase = $isBase; |
||
| 25 | file_put_contents($this->getPath(), $content); |
||
| 26 | $this->technicalName = $technicalName; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getName(): string |
||
| 30 | { |
||
| 31 | return $this->name; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getPath(): string |
||
| 35 | { |
||
| 36 | return sprintf('%s/_fixtures/%s.json', __DIR__, $this->getName()); |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getIso(): string |
||
| 40 | { |
||
| 41 | return $this->iso; |
||
| 42 | } |
||
| 43 | |||
| 44 | public function getAuthor(): string |
||
| 47 | } |
||
| 48 | |||
| 49 | public function isBase(): bool |
||
| 50 | { |
||
| 52 | } |
||
| 53 | |||
| 54 | public function getTechnicalName(): string |
||
| 59 |