Conversation
Signed-off-by: alexmerlin <alex.merlin.1985@gmail.com>
…thod Signed-off-by: alexmerlin <alex.merlin.1985@gmail.com>
|
@MarioRadu If you could take a look especially at my modifications in test/Unit/App/Middleware/DeprecationMiddlewareTest.php where I removed |
Signed-off-by: alexmerlin <alex.merlin.1985@gmail.com>
|
The issues reported by Qodana are false-positive errors. The errors are not thrown directly from the code in the |
I've seen the changes and they should be fine. |
| */ | ||
| public function handle(ServerRequestInterface $request): ResponseInterface | ||
| { | ||
| $inputFilter = (new CreateAdminInputFilter())->setData((array) $request->getParsedBody()); |
There was a problem hiding this comment.
What if we initialize the input filters in the constructor? Creating them on the fly it's not fully testable because you can't mock them.
(this comment applies to all input filters)
I'm thinking of something like this :
class PostAdminResourceHandler extends AbstractHandler
{
#[Inject(
AdminServiceInterface::class,
CreateAdminInputFilter::class,
)]
public function __construct(
protected AdminServiceInterface $adminService,
protected CreateAdminInputFilter $inputFilter,
) {
}
public function handle(ServerRequestInterface $request): ResponseInterface
{
$this->inputFilter->setData((array) $request->getParsedBody());
....
}
There was a problem hiding this comment.
Sounds good! 👍
Will implement it in a different PR.

No description provided.