diff --git a/composer.json b/composer.json index b29b690..da2abde 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ }, "autoload-dev": { "psr-4": { - "Tests\\": "tests/" + "Tests\\": "tests/", + "ProtoPhpGen\\": "tools/protoc-php-gen/src/" } }, "config": { diff --git a/config/routes.php b/config/routes.php index 3dd8c31..39f3070 100644 --- a/config/routes.php +++ b/config/routes.php @@ -2,7 +2,9 @@ declare(strict_types=1); +use App\Application\Handlers\AuthHandler; use App\Application\Handlers\HandlerInterface; +use App\Application\Handlers\HomeHandler; /** * WARNING: This file is automatically generated @@ -19,24 +21,24 @@ [ 'method' => 'POST', 'path' => '/api/v1/auth/login', - 'handler' => App\Application\Handlers\AuthHandler::class, + 'handler' => AuthHandler::class, ], // AuthService.Logout [ 'method' => 'POST', 'path' => '/api/v1/auth/logout', - 'handler' => App\Application\Handlers\AuthHandler::class, + 'handler' => AuthHandler::class, ], // AuthService.RefreshToken [ 'method' => 'POST', 'path' => '/api/v1/auth/refresh', - 'handler' => App\Application\Handlers\AuthHandler::class, + 'handler' => AuthHandler::class, ], // HomeService.Home [ 'method' => 'GET', 'path' => '/api/v1/home', - 'handler' => App\Application\Handlers\HomeHandler::class, - ] + 'handler' => HomeHandler::class, + ], ]; diff --git a/phpstan.neon b/phpstan.neon index 845e563..2020803 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,3 +6,5 @@ parameters: - tests - config - public + scanDirectories: + - tools/protoc-php-gen/src diff --git a/src/Application/Handlers/AuthHandler.php b/src/Application/Handlers/AuthHandler.php new file mode 100644 index 0000000..1e9d65b --- /dev/null +++ b/src/Application/Handlers/AuthHandler.php @@ -0,0 +1,31 @@ +jsonResponse('{"error":"Not implemented"}', 501); + } +} diff --git a/src/Domain/User/User.php b/src/Domain/User/User.php index 15a3272..e5b2377 100644 --- a/src/Domain/User/User.php +++ b/src/Domain/User/User.php @@ -8,7 +8,7 @@ use ProtoPhpGen\Attributes\ProtoField; use ProtoPhpGen\Attributes\ProtoMapping; -#[ProtoMapping(class: 'App\\Api\\V1\\User')] +#[ProtoMapping(class: 'App\Api\V1\User')] final readonly class User implements Entity { public function __construct(