| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 10 | class TestController extends AbstractController |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var FilesystemInterface |
||
| 14 | */ |
||
| 15 | private $privateFilesystem; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var FilesystemInterface |
||
| 19 | */ |
||
| 20 | private $publicFilesystem; |
||
| 21 | |||
| 22 | public function __construct(FilesystemInterface $privateFilesystem, FilesystemInterface $publicFilesystem) |
||
| 23 | { |
||
| 24 | $this->privateFilesystem = $privateFilesystem; |
||
| 25 | $this->publicFilesystem = $publicFilesystem; |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @Route("/test-filesystem", name="test.filesystem", methods={"GET"}) |
||
| 30 | */ |
||
| 31 | public function testFilesystem(): Response |
||
| 32 | { |
||
| 33 | $this->privateFilesystem->write('test.txt', 'foo bar private'); |
||
| 34 | $this->publicFilesystem->write('test.txt', 'foo bar public'); |
||
| 35 | |||
| 36 | $privateTest = $this->privateFilesystem->read('test.txt'); |
||
| 37 | $publicTest = $this->publicFilesystem->read('test.txt'); |
||
| 38 | |||
| 39 | return new Response($privateTest . '<br>' . $publicTest); |
||
| 40 | } |
||
| 42 |