strangebuzz /
MicroSymfony
| 1 | <?php |
||
| 2 | |||
| 3 | declare(strict_types=1); |
||
| 4 | |||
| 5 | namespace App\Controller; |
||
| 6 | |||
| 7 | use App\Helper\StringHelper; |
||
|
0 ignored issues
–
show
|
|||
| 8 | use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; |
||
| 9 | use Symfony\Component\HttpFoundation\Response; |
||
| 10 | use Symfony\Component\HttpKernel\Attribute\MapQueryParameter; |
||
| 11 | use Symfony\Component\Routing\Attribute\Route; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * This is an action implementing the ADR pattern. |
||
| 15 | * |
||
| 16 | * @see SlugifyActionTest |
||
| 17 | * @see https://symfony.com/doc/current/controller/service.html#invokable-controllers |
||
| 18 | */ |
||
| 19 | final class SlugifyAction extends AbstractController |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Simple API endpoint returning JSON. For a more serious API, please use API Platform 🕸. |
||
| 23 | * We can use the MapQueryParameter attribute to inject GET parameters. |
||
| 24 | * |
||
| 25 | * @see https://api-platform.com/ |
||
| 26 | */ |
||
| 27 | 1 | #[Route(path: '/api/slugify', name: self::class)] |
|
| 28 | public function __invoke(StringHelper $stringHelper, #[MapQueryParameter] string $title): Response |
||
| 29 | { |
||
| 30 | 1 | return $this->json(['slug' => $stringHelper->slugify($title)]); |
|
| 31 | } |
||
| 32 | } |
||
| 33 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths