Lines 66.66% 2 / 3
Methods 0.00% 0 / 1
Classes 0.00% 0 / 1
Name Lines Methods CRAP
 fromRoute 66.66% 2 / 3 0.00% 0 / 1 2.15
11final class RemoveDistrictCommandFactory
12{
13    /**
14     * @param array<string, string> $routeArgs
15     */
16    public function fromRoute(array $routeArgs, Request $request): RemoveDistrictCommand
17    {
18        if (!array_key_exists("id", $routeArgs)) {
19            throw new HttpBadRequestException($request);
20        }
21
22        return new RemoveDistrictCommand(intval($routeArgs["id"]));
23    }
24}