1 | <?php |
||
27 | class Renderer extends AbstractMiddleware implements MiddlewareInterface |
||
28 | { |
||
29 | |||
30 | /** |
||
31 | * @var ServerRequestInterface |
||
32 | */ |
||
33 | protected $request; |
||
34 | |||
35 | /** |
||
36 | * Handles a Request and updated the response |
||
37 | * |
||
38 | * @param ServerRequestInterface $request |
||
39 | * @param ResponseInterface $response |
||
40 | * |
||
41 | * @return ResponseInterface |
||
42 | */ |
||
43 | public function handle( |
||
54 | |||
55 | /** |
||
56 | * Adds a template path |
||
57 | * |
||
58 | * @param $path |
||
59 | */ |
||
60 | public function addTemplatePath($path) |
||
64 | |||
65 | /** |
||
66 | * Processes and renders the response |
||
67 | * |
||
68 | * @param ResponseInterface $response |
||
69 | * @return ResponseInterface|static |
||
70 | */ |
||
71 | protected function render(ResponseInterface $response) |
||
83 | |||
84 | /** |
||
85 | * Creates the engine for this rendering |
||
86 | * |
||
87 | * @return \Slick\Template\TemplateEngineInterface |
||
88 | */ |
||
89 | protected function getEngine() |
||
96 | |||
97 | /** |
||
98 | * Gets the template file for current request |
||
99 | * |
||
100 | * @return string |
||
101 | */ |
||
102 | protected function getTemplate() |
||
108 | |||
109 | /** |
||
110 | * Gets data to be processed |
||
111 | * |
||
112 | * @return array |
||
113 | */ |
||
114 | protected function getData() |
||
119 | |||
120 | /** |
||
121 | * Returns the default template from current request route |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | protected function getDefaultTemplate() |
||
132 | } |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.