-
-
Save mdzwigala/619708dd3b5b747b4423b3a17f9a7cfc to your computer and use it in GitHub Desktop.
ADR-EXAMPLE\Infrastructure\AddUserInputFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Infrastructure\ParamConverter\InputFactory; | |
use App\Action\Input\AddUserInput; | |
use Symfony\Component\HttpFoundation\Request; | |
final class AddUserInputFactory implements InputFactory | |
{ | |
public function createFromRequest(Request $request): AddUserInput | |
{ | |
return new AddUserInput( | |
(string)$request->request->get('email', ''), | |
(string)$request->request->get('password', '') | |
); | |
} | |
public static function supportedInput(): string | |
{ | |
return AddUserInput::class; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment