Ecodev /
artisans
| 1 | <?php |
||||
| 2 | |||||
| 3 | declare(strict_types=1); |
||||
| 4 | |||||
| 5 | use Application\Handler\SitemapHandler; |
||||
| 6 | use Ecodev\Felix\Handler\GraphQLHandler; |
||||
| 7 | use GraphQL\Upload\UploadMiddleware; |
||||
| 8 | use Mezzio\Application; |
||||
| 9 | use Mezzio\Helper\BodyParams\BodyParamsMiddleware; |
||||
| 10 | use Mezzio\MiddlewareFactory; |
||||
| 11 | use Psr\Container\ContainerInterface; |
||||
| 12 | |||||
| 13 | /* |
||||
| 14 | * Setup routes with a single request method: |
||||
| 15 | * |
||||
| 16 | * $app->get('/', App\Handler\HomePageHandler::class, 'home'); |
||||
| 17 | * $app->post('/album', App\Handler\AlbumCreateHandler::class, 'album.create'); |
||||
| 18 | * $app->put('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.put'); |
||||
| 19 | * $app->patch('/album/:id', App\Handler\AlbumUpdateHandler::class, 'album.patch'); |
||||
| 20 | * $app->delete('/album/:id', App\Handler\AlbumDeleteHandler::class, 'album.delete'); |
||||
| 21 | * |
||||
| 22 | * Or with multiple request methods: |
||||
| 23 | * |
||||
| 24 | * $app->route('/contact', App\Handler\ContactHandler::class, ['GET', 'POST', ...], 'contact'); |
||||
| 25 | * |
||||
| 26 | * Or handling all request methods: |
||||
| 27 | * |
||||
| 28 | * $app->route('/contact', App\Handler\ContactHandler::class)->setName('contact'); |
||||
| 29 | * |
||||
| 30 | * or: |
||||
| 31 | * |
||||
| 32 | * $app->route( |
||||
| 33 | * '/contact', |
||||
| 34 | * App\Handler\ContactHandler::class, |
||||
| 35 | * Mezzio\Router\Route::HTTP_METHOD_ANY, |
||||
| 36 | * 'contact' |
||||
| 37 | * ); |
||||
| 38 | */ |
||||
| 39 | return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { |
||||
|
0 ignored issues
–
show
The parameter
$container is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 40 | $app->post('/graphql', [ |
||||
| 41 | Ecodev\Felix\Middleware\SignedQueryMiddleware::class, |
||||
| 42 | BodyParamsMiddleware::class, |
||||
| 43 | UploadMiddleware::class, |
||||
| 44 | GraphQLHandler::class, |
||||
| 45 | ], 'graphql'); |
||||
| 46 | |||||
| 47 | $app->get('/api/image/{id:\d+}[/{maxHeight:\d+}]', [ |
||||
| 48 | Ecodev\Felix\Handler\ImageHandler::class, |
||||
| 49 | ], 'image'); |
||||
| 50 | |||||
| 51 | $app->get('/api/file/{id:\d+}', [ |
||||
| 52 | Ecodev\Felix\Handler\FileHandler::class, |
||||
| 53 | ], 'file'); |
||||
| 54 | |||||
| 55 | $app->post('/api/datatrans', [ |
||||
| 56 | BodyParamsMiddleware::class, |
||||
| 57 | \Application\Handler\DatatransHandler::class, |
||||
| 58 | ], 'datatrans'); |
||||
| 59 | |||||
| 60 | $app->get('/api/download-file', [ |
||||
| 61 | \Application\Handler\DownloadFile::class, |
||||
| 62 | ]); |
||||
| 63 | |||||
| 64 | $app->get('/api/download-counter', [ |
||||
| 65 | \Application\Handler\DownloadCounter::class, |
||||
| 66 | ]); |
||||
| 67 | |||||
| 68 | $app->get('/sitemap.xml', [ |
||||
| 69 | SitemapHandler::class, |
||||
| 70 | ], 'sitemap'); |
||||
| 71 | }; |
||||
| 72 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.