refactor : reorganize codebase to DDD architecture
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
Backend: - src/Api/Auth/State/ — MeProvider, UserPasswordHasherProcessor - src/Api/Shared/Resource/ — AppVersion - src/Api/Shared/State/ — AppVersionProvider - src/Domain/, src/Application/, src/Infrastructure/ — skeleton ready - User entity stays in src/Entity/ (framework, outside DDD) Frontend: - frontend/domains/ — skeleton ready for bounded contexts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
24
src/Api/Auth/State/MeProvider.php
Normal file
24
src/Api/Auth/State/MeProvider.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Api\Auth\State;
|
||||
|
||||
use ApiPlatform\Metadata\Operation;
|
||||
use ApiPlatform\State\ProviderInterface;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
|
||||
/**
|
||||
* @implements ProviderInterface<\App\Entity\User>
|
||||
*/
|
||||
class MeProvider implements ProviderInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly Security $security,
|
||||
) {}
|
||||
|
||||
public function provide(Operation $operation, array $uriVariables = [], array $context = []): ?object
|
||||
{
|
||||
return $this->security->getUser();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user