diff --git a/config/services.yaml b/config/services.yaml index 4e0021b..da562e0 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -17,12 +17,20 @@ services: App\: resource: '../src/*' - exclude: '../src/{Entity,Migrations,Tests,Kernel.php}' + exclude: '../src/{Api/V1/{DTO},Magnetico/{Entity,Migrations},Entity,FormRequest,Migrations,Tests,Kernel.php}' + # Use array in exclude config from Symfony 4.2 + #- '../src/Api/V1/{DTO}' + #- '../src/Magnetico/{Entity,Migrations}' + #- '../src/{Entity,FormRequest,Migrations,Tests,Kernel.php}' App\Controller\: resource: '../src/Controller' tags: ['controller.service_arguments'] + App\Api\V1\Controller\: + resource: '../src/Api/V1/Controller' + tags: ['controller.service_arguments'] + # Fast normalizer for Symfony Serializer get_set_method_normalizer: class: Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index 4960375..b4fee2f 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -2,7 +2,8 @@ namespace App\Controller; -use App\Form\{CreateUserRequest, CreateUserRequestType}; +use App\Form\{CreateUserRequestType}; +use App\FormRequest\CreateUserRequest; use App\Repository\{UserRepository}; use App\User\Exception\InvalidInviteException; use App\User\UserManager; diff --git a/src/Form/CreateUserRequestType.php b/src/Form/CreateUserRequestType.php index b83492d..9f076a2 100644 --- a/src/Form/CreateUserRequestType.php +++ b/src/Form/CreateUserRequestType.php @@ -2,10 +2,9 @@ namespace App\Form; +use App\FormRequest\CreateUserRequest; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\EmailType; -use Symfony\Component\Form\Extension\Core\Type\PasswordType; -use Symfony\Component\Form\Extension\Core\Type\TextType; +use Symfony\Component\Form\Extension\Core\Type\{EmailType, PasswordType, TextType}; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; diff --git a/src/Form/CreateUserRequest.php b/src/FormRequest/CreateUserRequest.php similarity index 96% rename from src/Form/CreateUserRequest.php rename to src/FormRequest/CreateUserRequest.php index 0647f39..6016905 100644 --- a/src/Form/CreateUserRequest.php +++ b/src/FormRequest/CreateUserRequest.php @@ -1,6 +1,6 @@