@@ -100,7 +100,7 @@ |
||
100 | 100 | |
101 | 101 | if (class_exists( "Puli\\TwigExtension\\PuliExtension" ) && null !== $this->repo) { |
102 | 102 | $loader = new \Twig_Loader_Chain( [ new PuliTemplateLoader( $this->repo ), new Twig_Loader_String() ] ); |
103 | - }else { |
|
103 | + } else { |
|
104 | 104 | $loader = new Twig_Loader_String(); |
105 | 105 | } |
106 | 106 | return $loader; |
@@ -107,7 +107,7 @@ |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
110 | - * @param $loader |
|
110 | + * @param Twig_LoaderInterface $loader |
|
111 | 111 | */ |
112 | 112 | protected function initTwig( $loader ) |
113 | 113 | { |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
145 | - * @return array |
|
145 | + * @return string[] |
|
146 | 146 | */ |
147 | 147 | public function __sleep() |
148 | 148 | { |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | /** |
185 | 185 | * Execute a component method within the page or component. |
186 | 186 | * Called first on a top level component which then passes the call down to the appropriate sub-component (or executes on itself if appropriate). |
187 | - * @param array|string $methodName A methodname in the format subComponent.anotherSubComponent.methodName. Either dotted string as described, or parts in an array. The top level page component shouldn't be included |
|
187 | + * @param string $methodName A methodname in the format subComponent.anotherSubComponent.methodName. Either dotted string as described, or parts in an array. The top level page component shouldn't be included |
|
188 | 188 | * @param array $args |
189 | 189 | * @throws \Exception |
190 | 190 | * @return Response |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
217 | - * @param $execMethod |
|
217 | + * @param string $execMethod |
|
218 | 218 | * @return string |
219 | 219 | */ |
220 | 220 | public function getExecPath( $execMethod ) |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | * Render a child component. |
323 | 323 | * |
324 | 324 | * @param $handle |
325 | - * @return Response |
|
325 | + * @return string |
|
326 | 326 | * @throws \Exception |
327 | 327 | */ |
328 | 328 | public function renderChild( $handle ) |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | if ($execMethodName) { // Used to test for null but it could easily be an empty string |
186 | 186 | $this->log( "Rendering with exec: {$execMethodName}, args:".var_export($execArgs, true ), LogLevel::DEBUG ); |
187 | 187 | $out = $this->execMethod( $execMethodName, $execArgs ); |
188 | - }else { |
|
188 | + } else { |
|
189 | 189 | $this->log( "Rendering without exec", LogLevel::DEBUG ); |
190 | 190 | $out = $this->template->render( $this->state, $this->props ); |
191 | 191 | if (!( $out instanceof Response )) { |
@@ -211,12 +211,12 @@ discard block |
||
211 | 211 | if (count( $methodName ) == 1) { |
212 | 212 | $methodName = $methodName[ 0 ] . 'Handler'; |
213 | 213 | $out = $this->$methodName( $args ); |
214 | - }else { |
|
214 | + } else { |
|
215 | 215 | $childName = array_shift( $methodName ); |
216 | 216 | $child = $this->childComponents[ $childName ]; |
217 | 217 | if ($child instanceof AbstractViewComponent) { |
218 | 218 | $out = $child->execMethod( $methodName, $args ); |
219 | - }else { |
|
219 | + } else { |
|
220 | 220 | throw new \Exception( implode( ".", $methodName ) . " is not a valid method." ); |
221 | 221 | } |
222 | 222 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | } |
302 | 302 | if (null !== ( $pPath = $this->parent->getPath() )) { |
303 | 303 | return $pPath . '.' . $this->handle; |
304 | - }else { |
|
304 | + } else { |
|
305 | 305 | return $this->handle; |
306 | 306 | } |
307 | 307 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | } |
325 | 325 | $child = new $type( $handle, $this, $this->exec, $this->logger ); |
326 | 326 | $this->childComponents[ $handle ] = $child; |
327 | - }else { |
|
327 | + } else { |
|
328 | 328 | // exec, di and logger are set recursively in rehydrate() |
329 | 329 | $child = $this->childComponents[ $handle ]; |
330 | 330 | } |
@@ -98,7 +98,7 @@ |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
101 | - * @param $templatePath |
|
101 | + * @param string $templatePath |
|
102 | 102 | * @return null|string |
103 | 103 | * @throws \Exception |
104 | 104 | */ |
@@ -86,11 +86,11 @@ |
||
86 | 86 | /** @noinspection PhpIncludeInspection */ |
87 | 87 | include( $realPath ); |
88 | 88 | $rendered = ob_get_clean(); |
89 | - }elseif ($this->templateString) { |
|
89 | + } elseif ($this->templateString) { |
|
90 | 90 | ob_start(); |
91 | 91 | eval( "?>" . $this->templateString ); |
92 | 92 | $rendered = ob_get_clean(); |
93 | - }else { |
|
93 | + } else { |
|
94 | 94 | throw new \Exception( "Neither valid template path no valid template string passed to PhpTemplate." ); |
95 | 95 | } |
96 | 96 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | if (null === $responseCode) { |
50 | 50 | if( $type == "redirect" ){ |
51 | 51 | $responseCode = 302; |
52 | - }else{ |
|
52 | + } else{ |
|
53 | 53 | $responseCode = 200; |
54 | 54 | } |
55 | 55 | } |