@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | /** |
| 278 | 278 | * Returns the left and right template delimiters. |
| 279 | 279 | * |
| 280 | - * @return array containing the left and the right delimiters |
|
| 280 | + * @return string[] containing the left and the right delimiters |
|
| 281 | 281 | */ |
| 282 | 282 | public function getDelimiters() |
| 283 | 283 | { |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | * Adds a preprocessor to the compiler, it will be called |
| 363 | 363 | * before the template is compiled. |
| 364 | 364 | * |
| 365 | - * @param mixed $callback either a valid callback to the preprocessor or a simple name if the autoload is set to |
|
| 365 | + * @param string $callback either a valid callback to the preprocessor or a simple name if the autoload is set to |
|
| 366 | 366 | * true |
| 367 | 367 | * @param bool $autoload if set to true, the preprocessor is auto-loaded from one of the plugin directories, else |
| 368 | 368 | * you must provide a valid callback |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | * |
| 1322 | 1322 | * @param array $params parameter array |
| 1323 | 1323 | * |
| 1324 | - * @return array tokens |
|
| 1324 | + * @return Compiler tokens |
|
| 1325 | 1325 | */ |
| 1326 | 1326 | public function getParamTokens(array $params) |
| 1327 | 1327 | { |
@@ -478,8 +478,7 @@ discard block |
||
| 478 | 478 | if (!class_exists($class) && !function_exists($class)) { |
| 479 | 479 | try { |
| 480 | 480 | $this->getCore()->getLoader()->loadPlugin($name); |
| 481 | - } |
|
| 482 | - catch (Exception $e) { |
|
| 481 | + } catch (Exception $e) { |
|
| 483 | 482 | throw new Exception('Processor ' . $name . ' could not be found in your plugin directories, please ensure it is in a file named ' . $name . '.php in the plugin directory'); |
| 484 | 483 | } |
| 485 | 484 | } |
@@ -1632,8 +1631,7 @@ discard block |
||
| 1632 | 1631 | // load if plugin |
| 1633 | 1632 | try { |
| 1634 | 1633 | $this->getPluginType('if'); |
| 1635 | - } |
|
| 1636 | - catch (Exception $e) { |
|
| 1634 | + } catch (Exception $e) { |
|
| 1637 | 1635 | throw new CompilationException($this, 'Assignments require the "if" plugin to be accessible'); |
| 1638 | 1636 | } |
| 1639 | 1637 | |
@@ -3454,8 +3452,7 @@ discard block |
||
| 3454 | 3452 | if ($pluginType === - 1) { |
| 3455 | 3453 | try { |
| 3456 | 3454 | $this->getCore()->getLoader()->loadPlugin('Plugin' . Core::toCamelCase($name)); |
| 3457 | - } |
|
| 3458 | - catch (Exception $e) { |
|
| 3455 | + } catch (Exception $e) { |
|
| 3459 | 3456 | if (isset($phpFunc)) { |
| 3460 | 3457 | $pluginType = Core::NATIVE_PLUGIN; |
| 3461 | 3458 | } elseif (is_object($this->getCore()->getPluginProxy()) && $this->getCore()->getPluginProxy()->handles($name)) { |
@@ -85,8 +85,8 @@ |
||
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | 87 | * @param $output |
| 88 | - * @param $dynamicId |
|
| 89 | - * @param $compiledFile |
|
| 88 | + * @param string $dynamicId |
|
| 89 | + * @param string $compiledFile |
|
| 90 | 90 | * |
| 91 | 91 | * @return mixed|string |
| 92 | 92 | */ |
@@ -64,8 +64,7 @@ |
||
| 64 | 64 | $compiler->findBlock('dynamic'); |
| 65 | 65 | |
| 66 | 66 | return $content; |
| 67 | - } |
|
| 68 | - catch (CompilationException $e) { |
|
| 67 | + } catch (CompilationException $e) { |
|
| 69 | 68 | } |
| 70 | 69 | $output = Compiler::PHP_OPEN . 'if($doCache) {' . "\n\t" . 'echo \'<dwoo:dynamic_\'.$dynamicId.\'>' . str_replace('\'', '\\\'', $content) . '</dwoo:dynamic_\'.$dynamicId.\'>\';' . "\n} else {\n\t"; |
| 71 | 70 | if (substr($content, 0, strlen(Compiler::PHP_OPEN)) == Compiler::PHP_OPEN) { |
@@ -59,7 +59,7 @@ |
||
| 59 | 59 | * @param string $append |
| 60 | 60 | * @param string $content |
| 61 | 61 | * |
| 62 | - * @return mixed|string |
|
| 62 | + * @return string |
|
| 63 | 63 | */ |
| 64 | 64 | public static function postProcessing(Compiler $compiler, array $params, $prepend, $append, $content) |
| 65 | 65 | { |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | /** |
| 30 | 30 | * @param string $input |
| 31 | 31 | * |
| 32 | - * @return mixed |
|
| 32 | + * @return string |
|
| 33 | 33 | */ |
| 34 | 34 | public function process($input) |
| 35 | 35 | { |
@@ -312,7 +312,7 @@ |
||
| 312 | 312 | |
| 313 | 313 | /** |
| 314 | 314 | * @param mixed $_tpl |
| 315 | - * @param array $data |
|
| 315 | + * @param Data $data |
|
| 316 | 316 | * @param null $_compiler |
| 317 | 317 | * @param bool $_output |
| 318 | 318 | * |
@@ -293,7 +293,7 @@ |
||
| 293 | 293 | * @param Core $core the dwoo instance that requests it |
| 294 | 294 | * @param string $output the template output |
| 295 | 295 | * |
| 296 | - * @return mixed full path of the cached file or false upon failure |
|
| 296 | + * @return false|string full path of the cached file or false upon failure |
|
| 297 | 297 | */ |
| 298 | 298 | public function cache(Core $core, $output) |
| 299 | 299 | { |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | * but after, you can only update existing globals. |
| 427 | 427 | * |
| 428 | 428 | * @param string $name |
| 429 | - * @param mixed $value |
|
| 429 | + * @param string $value |
|
| 430 | 430 | * |
| 431 | 431 | * @return $this |
| 432 | 432 | * @throws Exception |
@@ -576,7 +576,7 @@ discard block |
||
| 576 | 576 | * Adds a filter to this Dwoo instance, it will be used to filter the output of all the templates rendered by this |
| 577 | 577 | * instance. |
| 578 | 578 | * |
| 579 | - * @param mixed $callback a callback or a filter name if it is autoloaded from a plugin directory |
|
| 579 | + * @param Smarty\Filter\Adapter $callback a callback or a filter name if it is autoloaded from a plugin directory |
|
| 580 | 580 | * @param bool $autoload if true, the first parameter must be a filter name from one of the plugin directories |
| 581 | 581 | * |
| 582 | 582 | * @return void |
@@ -1614,7 +1614,7 @@ discard block |
||
| 1614 | 1614 | * @param mixed $value the value to assign |
| 1615 | 1615 | * @param string $scope the variable string, using dwoo variable syntax (i.e. "var.subvar[subsubvar]->property") |
| 1616 | 1616 | * |
| 1617 | - * @return bool true if assigned correctly or false if a problem occured while parsing the var string |
|
| 1617 | + * @return null|false true if assigned correctly or false if a problem occured while parsing the var string |
|
| 1618 | 1618 | */ |
| 1619 | 1619 | public function assignInScope($value, $scope) |
| 1620 | 1620 | { |
@@ -592,8 +592,7 @@ |
||
| 592 | 592 | if (!class_exists($class) && !function_exists($class)) { |
| 593 | 593 | try { |
| 594 | 594 | $this->getLoader()->loadPlugin($callback); |
| 595 | - } |
|
| 596 | - catch (Exception $e) { |
|
| 595 | + } catch (Exception $e) { |
|
| 597 | 596 | if (strstr($callback, self::NAMESPACE_PLUGINS_FILTERS)) { |
| 598 | 597 | throw new Exception('Wrong filter name : ' . $callback . ', the "Filter" prefix should not be used, please only use "' . str_replace('Filter', '', $callback) . '"'); |
| 599 | 598 | } else { |
@@ -66,11 +66,9 @@ |
||
| 66 | 66 | |
| 67 | 67 | try { |
| 68 | 68 | $include = $this->core->templateFactory($resource, $identifier, $cache_time, $cache_id, $compile_id); |
| 69 | - } |
|
| 70 | - catch (SecurityException $e) { |
|
| 69 | + } catch (SecurityException $e) { |
|
| 71 | 70 | $this->core->triggerError('Include : Security restriction : ' . $e->getMessage(), E_USER_WARNING); |
| 72 | - } |
|
| 73 | - catch (Exception $e) { |
|
| 71 | + } catch (Exception $e) { |
|
| 74 | 72 | $this->core->triggerError('Include : ' . $e->getMessage(), E_USER_WARNING); |
| 75 | 73 | } |
| 76 | 74 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * @param Compiler $compiler |
| 35 | 35 | * @param string $value |
| 36 | 36 | * |
| 37 | - * @return mixed |
|
| 37 | + * @return string |
|
| 38 | 38 | */ |
| 39 | 39 | public static function compile(Compiler $compiler, $value) |
| 40 | 40 | { |