Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
9 / 9 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| About | |
100.00% |
9 / 9 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __invoke | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Controller\System; |
| 6 | |
| 7 | use App\Controller\BaseController; |
| 8 | use Symfony\Bundle\FrameworkBundle\Console\Application; |
| 9 | use Symfony\Component\Console\Input\ArrayInput; |
| 10 | use Symfony\Component\Console\Output\BufferedOutput; |
| 11 | use Symfony\Component\DependencyInjection\Attribute\Autowire; |
| 12 | use Symfony\Component\HttpFoundation\Response; |
| 13 | use Symfony\Component\HttpKernel\KernelInterface; |
| 14 | use Symfony\Component\Routing\Attribute\Route; |
| 15 | use Symfony\Component\Security\Http\Attribute\IsGranted; |
| 16 | |
| 17 | #[Route('/system/about', name: 'system_about', methods: ['GET'])] |
| 18 | #[IsGranted('ROLE_ADMIN')] |
| 19 | class About extends BaseController |
| 20 | { |
| 21 | public function __construct(private readonly KernelInterface $kernel) {} |
| 22 | |
| 23 | public function __invoke( |
| 24 | #[Autowire('%kernel.project_dir%')] string $projectDir |
| 25 | ): Response |
| 26 | { |
| 27 | $output = new BufferedOutput(); |
| 28 | |
| 29 | $application = new Application($this->kernel); |
| 30 | $application->setAutoExit(false); |
| 31 | $application->run(new ArrayInput(['command' => 'about']), $output); |
| 32 | |
| 33 | return $this->render('system/about.html.twig', [ |
| 34 | 'project_dir' => $projectDir, |
| 35 | 'systemInfo' => $output->fetch(), |
| 36 | ]); |
| 37 | } |
| 38 | } |