Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #266: Replaced annotation-based dependency injection with attribute-based dependency injection #280

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
},
"require": {
"php": "~8.2.0 || ~8.3.0",
"ext-json": "*",
"ext-gd": "*",
"dotkernel/dot-annotated-services": "^4.1.7",
"ext-json": "*",
"dotkernel/dot-cache": "^4.0",
"dotkernel/dot-cli": "^3.5.0",
"dotkernel/dot-data-fixtures": "^1.1.3",
"dotkernel/dot-dependency-injection": "^1.0",
"dotkernel/dot-errorhandler": "^3.3.2",
"dotkernel/dot-mail": "^4.1.1",
"dotkernel/dot-response-header": "^3.2.3",
Expand Down
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Dot\Cli\ConfigProvider::class,
Dot\Log\ConfigProvider::class,
Dot\ErrorHandler\ConfigProvider::class,
Dot\AnnotatedServices\ConfigProvider::class,
Dot\DependencyInjection\ConfigProvider::class,

Check warning on line 47 in config/config.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'DependencyInjection'
Dot\ResponseHeader\ConfigProvider::class,
Dot\Mail\ConfigProvider::class,
Dot\DataFixtures\ConfigProvider::class,
Expand Down
18 changes: 9 additions & 9 deletions src/Admin/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
use Api\Admin\Service\AdminService;
use Api\Admin\Service\AdminServiceInterface;
use Api\App\ConfigProvider as AppConfigProvider;
use Dot\AnnotatedServices\Factory\AnnotatedRepositoryFactory;
use Dot\AnnotatedServices\Factory\AnnotatedServiceFactory;
use Dot\DependencyInjection\Factory\AttributedRepositoryFactory;

Check warning on line 23 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedRepositoryFactory'
use Dot\DependencyInjection\Factory\AttributedServiceFactory;

Check warning on line 24 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
use Mezzio\Hal\Metadata\MetadataMap;

class ConfigProvider
Expand All @@ -38,14 +38,14 @@
{
return [
'factories' => [
AdminHandler::class => AnnotatedServiceFactory::class,
AdminAccountHandler::class => AnnotatedServiceFactory::class,
AdminRoleHandler::class => AnnotatedServiceFactory::class,
AdminService::class => AnnotatedServiceFactory::class,
AdminRoleService::class => AnnotatedServiceFactory::class,
AdminHandler::class => AttributedServiceFactory::class,

Check warning on line 41 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
AdminAccountHandler::class => AttributedServiceFactory::class,

Check warning on line 42 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
AdminRoleHandler::class => AttributedServiceFactory::class,

Check warning on line 43 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
AdminService::class => AttributedServiceFactory::class,

Check warning on line 44 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
AdminRoleService::class => AttributedServiceFactory::class,

Check warning on line 45 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
AdminCreateCommand::class => AdminCreateCommandFactory::class,
AdminRepository::class => AnnotatedRepositoryFactory::class,
AdminRoleRepository::class => AnnotatedRepositoryFactory::class,
AdminRepository::class => AttributedRepositoryFactory::class,

Check warning on line 47 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedRepositoryFactory'
AdminRoleRepository::class => AttributedRepositoryFactory::class,

Check warning on line 48 in src/Admin/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedRepositoryFactory'
],
'aliases' => [
AdminServiceInterface::class => AdminService::class,
Expand Down
16 changes: 7 additions & 9 deletions src/Admin/src/Handler/AdminAccountHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Api\App\Exception\ConflictException;
use Api\App\Exception\NotFoundException;
use Api\App\Handler\HandlerTrait;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 14 in src/Admin/src/Handler/AdminAccountHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'
use Mezzio\Hal\HalResponseFactory;
use Mezzio\Hal\ResourceGenerator;
use Psr\Http\Message\ResponseInterface;
Expand All @@ -22,16 +22,14 @@
{
use HandlerTrait;

/**
* @Inject({
* HalResponseFactory::class,
* ResourceGenerator::class,
* AdminServiceInterface::class,
* "config"
* })
*/
#[Inject(

Check warning on line 25 in src/Admin/src/Handler/AdminAccountHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'
HalResponseFactory::class,
ResourceGenerator::class,

Check warning on line 27 in src/Admin/src/Handler/AdminAccountHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'ResourceGenerator'
AdminServiceInterface::class,
"config",
)]
public function __construct(
protected HalResponseFactory $responseFactory,

Check warning on line 32 in src/Admin/src/Handler/AdminAccountHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'HalResponseFactory'
protected ResourceGenerator $resourceGenerator,
protected AdminServiceInterface $adminService,
protected array $config,
Expand Down
16 changes: 7 additions & 9 deletions src/Admin/src/Handler/AdminHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
use Api\App\Exception\ConflictException;
use Api\App\Exception\NotFoundException;
use Api\App\Handler\HandlerTrait;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 14 in src/Admin/src/Handler/AdminHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'

Check warning on line 14 in src/Admin/src/Handler/AdminHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'
use Mezzio\Hal\HalResponseFactory;

Check warning on line 15 in src/Admin/src/Handler/AdminHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'HalResponseFactory'
use Mezzio\Hal\ResourceGenerator;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
Expand All @@ -22,14 +22,12 @@
{
use HandlerTrait;

/**
* @Inject({
* HalResponseFactory::class,
* ResourceGenerator::class,
* AdminServiceInterface::class,
* "config",
* })
*/
#[Inject(
HalResponseFactory::class,
ResourceGenerator::class,

Check warning on line 27 in src/Admin/src/Handler/AdminHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'ResourceGenerator'
AdminServiceInterface::class,
"config",
)]
public function __construct(
protected HalResponseFactory $responseFactory,
protected ResourceGenerator $resourceGenerator,
Expand Down
16 changes: 7 additions & 9 deletions src/Admin/src/Handler/AdminRoleHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Api\Admin\Service\AdminRoleServiceInterface;
use Api\App\Exception\NotFoundException;
use Api\App\Handler\HandlerTrait;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 10 in src/Admin/src/Handler/AdminRoleHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'
use Mezzio\Hal\HalResponseFactory;

Check warning on line 11 in src/Admin/src/Handler/AdminRoleHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'HalResponseFactory'
use Mezzio\Hal\ResourceGenerator;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
Expand All @@ -18,14 +18,12 @@
{
use HandlerTrait;

/**
* @Inject({
* HalResponseFactory::class,
* ResourceGenerator::class,
* AdminRoleServiceInterface::class,
* "config"
* })
*/
#[Inject(

Check warning on line 21 in src/Admin/src/Handler/AdminRoleHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'
HalResponseFactory::class,
ResourceGenerator::class,

Check warning on line 23 in src/Admin/src/Handler/AdminRoleHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'ResourceGenerator'
AdminRoleServiceInterface::class,
"config",
)]
public function __construct(
protected HalResponseFactory $responseFactory,
protected ResourceGenerator $resourceGenerator,
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/src/Repository/AdminRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
use Api\App\Helper\PaginationHelper;
use Api\App\Message;
use Doctrine\ORM\EntityRepository;
use Dot\AnnotatedServices\Annotation\Entity;
use Dot\DependencyInjection\Attribute\Entity;

Check warning on line 13 in src/Admin/src/Repository/AdminRepository.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'

/**
* @Entity(name="Api\Admin\Entity\Admin")
* @extends EntityRepository<object>
*/
#[Entity(name: Admin::class)]

Check warning on line 18 in src/Admin/src/Repository/AdminRepository.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Entity'
class AdminRepository extends EntityRepository
{
public function deleteAdmin(Admin $admin): void
Expand Down
4 changes: 2 additions & 2 deletions src/Admin/src/Repository/AdminRoleRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
use Api\Admin\Entity\AdminRole;
use Api\App\Helper\PaginationHelper;
use Doctrine\ORM\EntityRepository;
use Dot\AnnotatedServices\Annotation\Entity;
use Dot\DependencyInjection\Attribute\Entity;

Check warning on line 11 in src/Admin/src/Repository/AdminRoleRepository.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'

/**
* @Entity(name="Api\Admin\Entity\AdminRole")
* @extends EntityRepository<object>
*/
#[Entity(name: AdminRole::class)]

Check warning on line 16 in src/Admin/src/Repository/AdminRoleRepository.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Entity'
class AdminRoleRepository extends EntityRepository
{
public function getAdminRoles(array $filters = []): AdminRoleCollection
Expand Down
12 changes: 5 additions & 7 deletions src/Admin/src/Service/AdminRoleService.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@
use Api\Admin\Repository\AdminRoleRepository;
use Api\App\Exception\NotFoundException;
use Api\App\Message;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 12 in src/Admin/src/Service/AdminRoleService.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'

class AdminRoleService implements AdminRoleServiceInterface
{
/**
* @Inject({
* AdminRoleRepository::class
* })
*/
#[Inject(

Check warning on line 16 in src/Admin/src/Service/AdminRoleService.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'
AdminRoleRepository::class,
)]
public function __construct(
protected AdminRoleRepository $adminRoleRepository
protected AdminRoleRepository $adminRoleRepository,
) {
}

Expand Down
14 changes: 6 additions & 8 deletions src/Admin/src/Service/AdminService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@
use Api\App\Exception\ConflictException;
use Api\App\Exception\NotFoundException;
use Api\App\Message;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 14 in src/Admin/src/Service/AdminService.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'

class AdminService implements AdminServiceInterface
{
/**
* @Inject({
* AdminRoleService::class,
* AdminRepository::class
* })
*/
#[Inject(

Check warning on line 18 in src/Admin/src/Service/AdminService.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'
AdminRoleService::class,
AdminRepository::class,
)]
public function __construct(
protected AdminRoleService $adminRoleService,
protected AdminRepository $adminRepository
protected AdminRepository $adminRepository,
) {
}

Expand Down
12 changes: 6 additions & 6 deletions src/App/src/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use Api\App\Service\ErrorReportServiceInterface;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Dot\AnnotatedServices\Factory\AnnotatedServiceFactory;
use Dot\DependencyInjection\Factory\AttributedServiceFactory;

Check warning on line 23 in src/App/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
use Dot\Mail\Factory\MailOptionsAbstractFactory;
use Dot\Mail\Factory\MailServiceAbstractFactory;
use Dot\Mail\Service\MailService;
Expand Down Expand Up @@ -64,16 +64,16 @@
'dot-mail.options.default' => MailOptionsAbstractFactory::class,
'dot-mail.service.default' => MailServiceAbstractFactory::class,
AuthenticationMiddleware::class => AuthenticationMiddlewareFactory::class,
AuthorizationMiddleware::class => AnnotatedServiceFactory::class,
ContentNegotiationMiddleware::class => AnnotatedServiceFactory::class,
AuthorizationMiddleware::class => AttributedServiceFactory::class,

Check warning on line 67 in src/App/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
ContentNegotiationMiddleware::class => AttributedServiceFactory::class,

Check warning on line 68 in src/App/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
Environment::class => TwigEnvironmentFactory::class,
TwigExtension::class => TwigExtensionFactory::class,
TwigRenderer::class => TwigRendererFactory::class,
HomeHandler::class => AnnotatedServiceFactory::class,
ErrorResponseMiddleware::class => AnnotatedServiceFactory::class,
HomeHandler::class => AttributedServiceFactory::class,

Check warning on line 72 in src/App/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
ErrorResponseMiddleware::class => AttributedServiceFactory::class,

Check warning on line 73 in src/App/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
RouteListCommand::class => RouteListCommandFactory::class,
TokenGenerateCommand::class => TokenGenerateCommandFactory::class,
ErrorReportService::class => AnnotatedServiceFactory::class,
ErrorReportService::class => AttributedServiceFactory::class,

Check warning on line 76 in src/App/src/ConfigProvider.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AttributedServiceFactory'
EntityListenerResolver::class => EntityListenerResolverFactory::class,
],
'aliases' => [
Expand Down
20 changes: 7 additions & 13 deletions src/App/src/Handler/ErrorReportHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,25 @@
use Api\App\Exception\ForbiddenException;
use Api\App\Message;
use Api\App\Service\ErrorReportServiceInterface;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\AnnotatedServices\Annotation\Service;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 10 in src/App/src/Handler/ErrorReportHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'

Check warning on line 10 in src/App/src/Handler/ErrorReportHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'
use Fig\Http\Message\StatusCodeInterface;
use Mezzio\Hal\HalResponseFactory;

Check warning on line 12 in src/App/src/Handler/ErrorReportHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'HalResponseFactory'
use Mezzio\Hal\ResourceGenerator;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
use RuntimeException;

/**
* @Service
*/
class ErrorReportHandler implements RequestHandlerInterface
{
use HandlerTrait;

/**
* @Inject({
* HalResponseFactory::class,
* ResourceGenerator::class,
* ErrorReportServiceInterface::class,
* "config"
* })
*/
#[Inject(
HalResponseFactory::class,
ResourceGenerator::class,

Check warning on line 25 in src/App/src/Handler/ErrorReportHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'ResourceGenerator'
ErrorReportServiceInterface::class,
"config",
)]
public function __construct(
protected HalResponseFactory $responseFactory,
protected ResourceGenerator $resourceGenerator,
Expand Down
14 changes: 6 additions & 8 deletions src/App/src/Handler/HomeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Api\App\Handler;

use Dot\AnnotatedServices\Annotation\Inject;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 7 in src/App/src/Handler/HomeHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'

Check warning on line 7 in src/App/src/Handler/HomeHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'
use Mezzio\Hal\HalResponseFactory;
use Mezzio\Hal\ResourceGenerator;
use Psr\Http\Message\ResponseInterface;
Expand All @@ -14,15 +14,13 @@
{
use HandlerTrait;

/**
* @Inject({
* HalResponseFactory::class,
* ResourceGenerator::class,
* "config"
* })
*/
#[Inject(
HalResponseFactory::class,
ResourceGenerator::class,

Check warning on line 19 in src/App/src/Handler/HomeHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'ResourceGenerator'
"config",
)]
public function __construct(
protected HalResponseFactory $responseFactory,

Check warning on line 23 in src/App/src/Handler/HomeHandler.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'HalResponseFactory'
protected ResourceGenerator $resourceGenerator,
protected array $config,
) {
Expand Down
16 changes: 7 additions & 9 deletions src/App/src/Middleware/AuthorizationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
use Api\App\UserIdentity;
use Api\User\Entity\User;
use Api\User\Repository\UserRepository;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 15 in src/App/src/Middleware/AuthorizationMiddleware.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'
use Fig\Http\Message\StatusCodeInterface;
use Laminas\Diactoros\Response\JsonResponse;
use Mezzio\Authentication\UserInterface;
use Mezzio\Authorization\AuthorizationInterface;

Check warning on line 19 in src/App/src/Middleware/AuthorizationMiddleware.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'AuthorizationInterface'
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
Expand All @@ -27,17 +27,15 @@

class AuthorizationMiddleware implements MiddlewareInterface
{
/**
* @Inject({
* AuthorizationInterface::class,
* UserRepository::class,
* AdminRepository::class
* })
*/
#[Inject(

Check warning on line 30 in src/App/src/Middleware/AuthorizationMiddleware.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'
AuthorizationInterface::class,
UserRepository::class,
AdminRepository::class,
)]
public function __construct(
protected AuthorizationInterface $authorization,
protected UserRepository $userRepository,
protected AdminRepository $adminRepository
protected AdminRepository $adminRepository,
) {
}

Expand Down
13 changes: 7 additions & 6 deletions src/App/src/Middleware/ContentNegotiationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Api\App\Middleware;

use Api\App\Handler\ResponseTrait;
use Dot\AnnotatedServices\Annotation\Inject;
use Dot\DependencyInjection\Attribute\Inject;

Check warning on line 8 in src/App/src/Middleware/ContentNegotiationMiddleware.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined namespace

Undefined namespace 'Attribute'
use Mezzio\Router\RouteResult;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
Expand All @@ -26,11 +26,12 @@
{
use ResponseTrait;

/**
* @Inject({"config.content-negotiation"})
*/
public function __construct(private array $config)
{
#[Inject(

Check warning on line 29 in src/App/src/Middleware/ContentNegotiationMiddleware.php

View workflow job for this annotation

GitHub Actions / Qodana for PHP

Undefined class

Undefined class 'Inject'
"config.content-negotiation",
)]
public function __construct(
private array $config,
) {
}

public function process(
Expand Down
Loading
Loading