Loading app/composer.json +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ "minimum-stability": "stable", "prefer-stable": true, "require": { "php": ">=8.1", "php": ">=8.2", "ext-ctype": "*", "ext-iconv": "*", "doctrine/dbal": "^3", Loading app/config/packages/doctrine.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -21,8 +21,8 @@ doctrine: App: type: attribute is_bundle: false dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' dir: '%kernel.project_dir%/src/Shared/Entity' prefix: 'App\Shared\Entity' alias: App controller_resolver: auto_mapping: true Loading app/config/routes.yaml +9 −3 Original line number Diff line number Diff line controllers: newsControllers: resource: path: ../src/Controller/ namespace: App\Controller path: ../src/News/Controller/ namespace: App\News\Controller type: attribute restaurantsControllers: resource: path: ../src/Restaurants/Controller/ namespace: App\Restaurants\Controller type: attribute app/config/services.yaml +9 −9 Original line number Diff line number Diff line Loading @@ -11,14 +11,14 @@ services: autowire: true # Automatically injects dependencies in your services. autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. # makes classes in src/ available to be used as services # this creates a service per class whose id is the fully-qualified class name App\: resource: '../src/' exclude: - '../src/DependencyInjection/' - '../src/Entity/' - '../src/Kernel.php' # add more service definitions when explicit configuration is needed # please note that last definitions always *replace* previous ones App\Restaurants\: resource: '../src/Restaurants/' App\News\: resource: '../src/News/' App\Shared\: resource: '../src/Shared/' No newline at end of file app/src/Controller/Handle.phpdeleted 100644 → 0 +0 −32 Original line number Diff line number Diff line <?php namespace App\Controller; use App\Request\AbstractRequest; use App\Service\ServiceInterface; use Symfony\Component\HttpFoundation\JsonResponse; class Handle { public function __construct(private readonly ServiceInterface $service) {} public function handle(AbstractRequest $request): JsonResponse { // try { return new JsonResponse($this->service->serve($request)); // // } catch (AbstractError $error) { // $errorDto = new ErrorDto(); // // $errorDto->message = $error->message; // $errorDto->code = $error->code; // $errorDto->status = $error->status; // // return new JsonResponse($errorDto, $error->status); // // } catch (Throwable $exception) { // $error = new ErrorDto(); // return new JsonResponse($error, $error->status); // } } } Loading
app/composer.json +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ "minimum-stability": "stable", "prefer-stable": true, "require": { "php": ">=8.1", "php": ">=8.2", "ext-ctype": "*", "ext-iconv": "*", "doctrine/dbal": "^3", Loading
app/config/packages/doctrine.yaml +2 −2 Original line number Diff line number Diff line Loading @@ -21,8 +21,8 @@ doctrine: App: type: attribute is_bundle: false dir: '%kernel.project_dir%/src/Entity' prefix: 'App\Entity' dir: '%kernel.project_dir%/src/Shared/Entity' prefix: 'App\Shared\Entity' alias: App controller_resolver: auto_mapping: true Loading
app/config/routes.yaml +9 −3 Original line number Diff line number Diff line controllers: newsControllers: resource: path: ../src/Controller/ namespace: App\Controller path: ../src/News/Controller/ namespace: App\News\Controller type: attribute restaurantsControllers: resource: path: ../src/Restaurants/Controller/ namespace: App\Restaurants\Controller type: attribute
app/config/services.yaml +9 −9 Original line number Diff line number Diff line Loading @@ -11,14 +11,14 @@ services: autowire: true # Automatically injects dependencies in your services. autoconfigure: true # Automatically registers your services as commands, event subscribers, etc. # makes classes in src/ available to be used as services # this creates a service per class whose id is the fully-qualified class name App\: resource: '../src/' exclude: - '../src/DependencyInjection/' - '../src/Entity/' - '../src/Kernel.php' # add more service definitions when explicit configuration is needed # please note that last definitions always *replace* previous ones App\Restaurants\: resource: '../src/Restaurants/' App\News\: resource: '../src/News/' App\Shared\: resource: '../src/Shared/' No newline at end of file
app/src/Controller/Handle.phpdeleted 100644 → 0 +0 −32 Original line number Diff line number Diff line <?php namespace App\Controller; use App\Request\AbstractRequest; use App\Service\ServiceInterface; use Symfony\Component\HttpFoundation\JsonResponse; class Handle { public function __construct(private readonly ServiceInterface $service) {} public function handle(AbstractRequest $request): JsonResponse { // try { return new JsonResponse($this->service->serve($request)); // // } catch (AbstractError $error) { // $errorDto = new ErrorDto(); // // $errorDto->message = $error->message; // $errorDto->code = $error->code; // $errorDto->status = $error->status; // // return new JsonResponse($errorDto, $error->status); // // } catch (Throwable $exception) { // $error = new ErrorDto(); // return new JsonResponse($error, $error->status); // } } }