Code Duplication    Length = 3-9 lines in 3 locations

Routing/Loader/RestRouteLoader.php 2 locations

@@ 58-60 (lines=3) @@
55
56
            $this->controllerParser = $controllerReader;
57
58
            if (!$defaultFormat instanceof RestControllerReader) {
59
                throw new \TypeError(sprintf('Argument 4 passed to %s() must be an instance of %s, %s given.', __METHOD__, RestControllerReader::class, is_object($defaultFormat) ? get_class($defaultFormat) : gettype($defaultFormat)));
60
            }
61
62
            $this->controllerReader = $defaultFormat;
63
            $this->defaultFormat = func_num_args() > 4 ? func_get_arg(4) : 'html';
@@ 64-66 (lines=3) @@
61
62
            $this->controllerReader = $defaultFormat;
63
            $this->defaultFormat = func_num_args() > 4 ? func_get_arg(4) : 'html';
64
        } elseif (!$controllerReader instanceof RestControllerReader) {
65
            throw new \TypeError(sprintf('Argument 3 passed to %s() must be an instance of %s, %s given.', __METHOD__, RestControllerReader::class, is_object($controllerReader) ? get_class($controllerReader) : gettype($controllerReader)));
66
        } else {
67
            $this->controllerReader = $controllerReader;
68
            $this->defaultFormat = $defaultFormat;
69
        }

Controller/TemplatingExceptionController.php 1 location

@@ 34-42 (lines=9) @@
31
        $showException,
32
        $templating
33
    ) {
34
        if (!$templating instanceof EngineInterface && !$templating instanceof Environment) {
35
            throw new \TypeError(sprintf('The fourth argument of %s must be an instance of %s or %s, but %s was given.', __METHOD__, EngineInterface::class, Environment::class, is_object($templating) ? get_class($templating) : gettype($templating)));
36
        }
37
38
        parent::__construct($viewHandler, $exceptionCodes, $showException);
39
40
        $this->templating = $templating;
41
    }
42
43
    /**
44
     * Finds the template for the given format and status code.
45
     *