| @@ 31-39 (lines=9) @@ | ||
| 28 | $showException, |
|
| 29 | $templating |
|
| 30 | ) { |
|
| 31 | if (!$templating instanceof EngineInterface && !$templating instanceof Environment) { |
|
| 32 | throw new \TypeError(sprintf( |
|
| 33 | 'The fourth argument of %s must be an instance of %s or %s, but %s was given.', |
|
| 34 | __METHOD__, |
|
| 35 | EngineInterface::class, |
|
| 36 | Environment::class, |
|
| 37 | is_object($templating) ? get_class($templating) : gettype($templating) |
|
| 38 | )); |
|
| 39 | } |
|
| 40 | ||
| 41 | parent::__construct($viewHandler, $exceptionCodes, $showException); |
|
| 42 | ||
| @@ 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 | } |
|