@@ 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 | } |