Adding middleware to a route problem

Hi everyone.
I made some nice validtion middleware. I defined it in my container and everythnig works well while I add it as an application middleware:


but the moment I try to add it as a rotute middleware:

$app->map(['GET', 'POST'], '/subscribe', function(Request $req, Response $resp) {
    return $this->get(AuthenticationController::class)->subscribeCredential($req, $resp);

I received some annoying error message:

PHP Fatal error: Cannot declare class Paneric\Validation\ValidationMiddleware, because the name is already in use in ValidationMiddleware.php (my class definition).

Any suggestion on “why” and “how” highly appreciated :).