Hello, thanks for this package. I want to submit PR that covers usage of php attributes ( #404 )
The short example why it is useful: imagine that you start a symfony project from skeleton
symfony new my_project_directory --version="7.0.*" --webapp
As you can see it is not dependent on symfony/routing
And create simple controller in src/Controllers
<?php
declare(strict_types=1);
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Attribute\Route;
final class FooController extends AbstractController
{
#[Route('/foo')]
public function invoke(): JsonResponse
{
return new JsonResponse();
}
}
Now it starts to depend on symfony/routing
So, if you run checker output will be:
$ XDEBUG_MODE=off vendor/bin/composer-require-checker
ComposerRequireChecker 4.8.0@1c7498e4c31ff7e467ac1b5138d277736c838393
The following 2 unknown symbols were found:
+-----------------------------------------------+--------------------+
| Unknown Symbol | Guessed Dependency |
+-----------------------------------------------+--------------------+
| Symfony\Component\HttpFoundation\JsonResponse | |
| Symfony\Component\HttpKernel\Kernel | |
+-----------------------------------------------+--------------------+
No warning about Symfony\Component\Routing\Attribute\Route attribute
My branch produces that output:
XDEBUG_MODE=off vendor/bin/composer-require-checker
ComposerRequireChecker dev-php-attributes@bd0f004bd5c6b2214eb6a5fa273b0227745e0568
The following 3 unknown symbols were found:
+-----------------------------------------------+--------------------+
| Unknown Symbol | Guessed Dependency |
+-----------------------------------------------+--------------------+
| Symfony\Component\HttpFoundation\JsonResponse | |
| Symfony\Component\HttpKernel\Kernel | |
| Symfony\Component\Routing\Attribute\Route | |
+-----------------------------------------------+--------------------+
Hello, thanks for this package. I want to submit PR that covers usage of php attributes ( #404 )
The short example why it is useful: imagine that you start a symfony project from skeleton
symfony new my_project_directory --version="7.0.*" --webapp
As you can see it is not dependent on symfony/routing And create simple controller in src/ControllersNow it starts to depend on symfony/routing
So, if you run checker output will be:
No warning about Symfony\Component\Routing\Attribute\Route attribute
My branch produces that output: