| @@ -46,7 +46,7 @@ | ||
| 46 | 46 | /** | 
| 47 | 47 | * Dwoo_Adapters_ZendFramework_PluginProxy's constructor. | 
| 48 | 48 | * | 
| 49 | - * @param Zend_View_Interface $view | |
| 49 | + * @param Dwoo_Adapters_ZendFramework_View $view | |
| 50 | 50 | */ | 
| 51 | 51 | public function __construct(Zend_View_Interface $view) | 
| 52 | 52 |      { | 
| @@ -83,7 +83,6 @@ discard block | ||
| 83 | 83 | * - type class name or object for engine, dataProvider or compiler | 
| 84 | 84 | * - any set* method (compileDir for setCompileDir ...) | 
| 85 | 85 | * | 
| 86 | - * @param array $options | |
| 87 | 86 | * | 
| 88 | 87 | * @return Dwoo_Adapters_ZendFramework_View | 
| 89 | 88 | */ | 
| @@ -437,7 +436,6 @@ discard block | ||
| 437 | 436 | * Processes a view script and outputs it. Output is then | 
| 438 | 437 | * passed through filters. | 
| 439 | 438 | * | 
| 440 | - * @param string $name The script script name to process | |
| 441 | 439 | * | 
| 442 | 440 | * @return string The script output | 
| 443 | 441 | */ | 
| @@ -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 |      { | 
| @@ -769,13 +769,13 @@ discard block | ||
| 769 | 769 |                          $search = array('{<\?.*?\?>}', '{<%.*?%>}'); | 
| 770 | 770 | } | 
| 771 | 771 |                      switch ($this->securityPolicy->getPhpHandling()) { | 
| 772 | - case SecurityPolicy::PHP_ALLOW: | |
| 773 | - break; | |
| 774 | - case SecurityPolicy::PHP_ENCODE: | |
| 775 | - $tpl = preg_replace_callback($search, array($this, 'phpTagEncodingHelper'), $tpl); | |
| 776 | - break; | |
| 777 | - case SecurityPolicy::PHP_REMOVE: | |
| 778 | - $tpl = preg_replace($search, '', $tpl); | |
| 772 | + case SecurityPolicy::PHP_ALLOW: | |
| 773 | + break; | |
| 774 | + case SecurityPolicy::PHP_ENCODE: | |
| 775 | + $tpl = preg_replace_callback($search, array($this, 'phpTagEncodingHelper'), $tpl); | |
| 776 | + break; | |
| 777 | + case SecurityPolicy::PHP_REMOVE: | |
| 778 | + $tpl = preg_replace($search, '', $tpl); | |
| 779 | 779 | } | 
| 780 | 780 | } | 
| 781 | 781 | } | 
| @@ -875,42 +875,42 @@ discard block | ||
| 875 | 875 | } | 
| 876 | 876 | |
| 877 | 877 |              switch ($type) { | 
| 878 | - case Core::BLOCK_PLUGIN: | |
| 879 | - case Core::CLASS_PLUGIN: | |
| 880 | -                    if (class_exists('Plugin' . $plugin) !== false) { | |
| 881 | -                        $output .= "if (class_exists('" . "Plugin" . $plugin . "')===false)". | |
| 882 | -                        "\n\t\$this->getLoader()->loadPlugin('Plugin$plugin');\n"; | |
| 883 | -                    } else { | |
| 884 | -                        $output .= "if (class_exists('" . Core::NAMESPACE_PLUGINS_BLOCKS . "Plugin" . $plugin . "')===false)". | |
| 885 | -                        "\n\t\$this->getLoader()->loadPlugin('Plugin$plugin');\n"; | |
| 886 | - } | |
| 887 | - break; | |
| 888 | - case Core::FUNC_PLUGIN: | |
| 889 | -                    if (function_exists('Plugin' . $plugin) !== false) { | |
| 890 | -                        $output .= "if (function_exists('" . "Plugin" . $plugin . "')===false)". | |
| 891 | -                        "\n\t\$this->getLoader()->loadPlugin('Plugin$plugin');\n"; | |
| 892 | -                    } else { | |
| 893 | -                        $output .= "if (function_exists('" . Core::NAMESPACE_PLUGINS_FUNCTIONS . "Plugin" . $plugin . "')===false)". | |
| 894 | -                        "\n\t\$this->getLoader()->loadPlugin('Plugin$plugin');\n"; | |
| 895 | - } | |
| 896 | - break; | |
| 897 | - case Core::SMARTY_MODIFIER: | |
| 898 | -                    $output .= "if (function_exists('smarty_modifier_$plugin')===false)". | |
| 899 | -                    "\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; | |
| 900 | - break; | |
| 901 | - case Core::SMARTY_FUNCTION: | |
| 902 | -                    $output .= "if (function_exists('smarty_function_$plugin')===false)". | |
| 903 | -                    "\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; | |
| 904 | - break; | |
| 905 | - case Core::SMARTY_BLOCK: | |
| 906 | -                    $output .= "if (function_exists('smarty_block_$plugin')===false)". | |
| 907 | -                    "\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; | |
| 908 | - break; | |
| 909 | - case Core::PROXY_PLUGIN: | |
| 910 | - $output .= $this->getDwoo()->getPluginProxy()->getLoader($plugin); | |
| 911 | - break; | |
| 912 | - default: | |
| 913 | - throw new CompilationException($this, 'Type error for ' . $plugin . ' with type' . $type); | |
| 878 | + case Core::BLOCK_PLUGIN: | |
| 879 | + case Core::CLASS_PLUGIN: | |
| 880 | +                if (class_exists('Plugin' . $plugin) !== false) { | |
| 881 | +                    $output .= "if (class_exists('" . "Plugin" . $plugin . "')===false)". | |
| 882 | +                    "\n\t\$this->getLoader()->loadPlugin('Plugin$plugin');\n"; | |
| 883 | +                } else { | |
| 884 | +                    $output .= "if (class_exists('" . Core::NAMESPACE_PLUGINS_BLOCKS . "Plugin" . $plugin . "')===false)". | |
| 885 | +                    "\n\t\$this->getLoader()->loadPlugin('Plugin$plugin');\n"; | |
| 886 | + } | |
| 887 | + break; | |
| 888 | + case Core::FUNC_PLUGIN: | |
| 889 | +                if (function_exists('Plugin' . $plugin) !== false) { | |
| 890 | +                    $output .= "if (function_exists('" . "Plugin" . $plugin . "')===false)". | |
| 891 | +                    "\n\t\$this->getLoader()->loadPlugin('Plugin$plugin');\n"; | |
| 892 | +                } else { | |
| 893 | +                    $output .= "if (function_exists('" . Core::NAMESPACE_PLUGINS_FUNCTIONS . "Plugin" . $plugin . "')===false)". | |
| 894 | +                    "\n\t\$this->getLoader()->loadPlugin('Plugin$plugin');\n"; | |
| 895 | + } | |
| 896 | + break; | |
| 897 | + case Core::SMARTY_MODIFIER: | |
| 898 | +                $output .= "if (function_exists('smarty_modifier_$plugin')===false)". | |
| 899 | +                "\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; | |
| 900 | + break; | |
| 901 | + case Core::SMARTY_FUNCTION: | |
| 902 | +                $output .= "if (function_exists('smarty_function_$plugin')===false)". | |
| 903 | +                "\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; | |
| 904 | + break; | |
| 905 | + case Core::SMARTY_BLOCK: | |
| 906 | +                $output .= "if (function_exists('smarty_block_$plugin')===false)". | |
| 907 | +                "\n\t\$this->getLoader()->loadPlugin('$plugin');\n"; | |
| 908 | + break; | |
| 909 | + case Core::PROXY_PLUGIN: | |
| 910 | + $output .= $this->getDwoo()->getPluginProxy()->getLoader($plugin); | |
| 911 | + break; | |
| 912 | + default: | |
| 913 | + throw new CompilationException($this, 'Type error for ' . $plugin . ' with type' . $type); | |
| 914 | 914 | } | 
| 915 | 915 | } | 
| 916 | 916 | |
| @@ -536,7 +536,7 @@ discard block | ||
| 536 | 536 | * Adds a filter to this Dwoo instance, it will be used to filter the output of all the templates rendered by this | 
| 537 | 537 | * instance. | 
| 538 | 538 | * | 
| 539 | - * @param mixed $callback a callback or a filter name if it is autoloaded from a plugin directory | |
| 539 | + * @param Smarty\Filter\Adapter $callback a callback or a filter name if it is autoloaded from a plugin directory | |
| 540 | 540 | * @param bool $autoload if true, the first parameter must be a filter name from one of the plugin directories | 
| 541 | 541 | * | 
| 542 | 542 | * @return void | 
| @@ -1547,7 +1547,7 @@ discard block | ||
| 1547 | 1547 | * @param mixed $value the value to assign | 
| 1548 | 1548 | * @param string $scope the variable string, using dwoo variable syntax (i.e. "var.subvar[subsubvar]->property") | 
| 1549 | 1549 | * | 
| 1550 | - * @return bool true if assigned correctly or false if a problem occured while parsing the var string | |
| 1550 | + * @return null|false true if assigned correctly or false if a problem occured while parsing the var string | |
| 1551 | 1551 | */ | 
| 1552 | 1552 | public function assignInScope($value, $scope) | 
| 1553 | 1553 |      { | 
| @@ -57,7 +57,7 @@ | ||
| 57 | 57 | /** | 
| 58 | 58 | * Loader constructor. | 
| 59 | 59 | * | 
| 60 | - * @param $cacheDir | |
| 60 | + * @param string $cacheDir | |
| 61 | 61 | */ | 
| 62 | 62 | public function __construct($cacheDir) | 
| 63 | 63 |      { | 
| @@ -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 | */ | 
| @@ -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 |      { | 
| @@ -67,12 +67,12 @@ | ||
| 67 | 67 | |
| 68 | 68 | $mode = trim($params['mode'], '"\''); | 
| 69 | 69 |          switch ($mode) { | 
| 70 | - case 'js': | |
| 71 | - case 'javascript': | |
| 72 | -                $content = preg_replace('#(?<!:)//\s[^\r\n]*|/\*.*?\*/#s', '', $content); | |
| 70 | + case 'js': | |
| 71 | + case 'javascript': | |
| 72 | +            $content = preg_replace('#(?<!:)//\s[^\r\n]*|/\*.*?\*/#s', '', $content); | |
| 73 | 73 | |
| 74 | - case 'default': | |
| 75 | - default: | |
| 74 | + case 'default': | |
| 75 | + default: | |
| 76 | 76 | } | 
| 77 | 77 | $content = preg_replace(array( | 
| 78 | 78 | "/\n/", | 
| @@ -86,6 +86,9 @@ discard block | ||
| 86 | 86 | return $out; | 
| 87 | 87 | } | 
| 88 | 88 | |
| 89 | + /** | |
| 90 | + * @param string $i | |
| 91 | + */ | |
| 89 | 92 | protected function exportVar($i, $v) | 
| 90 | 93 |      { | 
| 91 | 94 |          if (is_string($v) || is_bool($v) || is_numeric($v)) { | 
| @@ -99,6 +102,9 @@ discard block | ||
| 99 | 102 | } | 
| 100 | 103 | } | 
| 101 | 104 | |
| 105 | + /** | |
| 106 | + * @param string $i | |
| 107 | + */ | |
| 102 | 108 | protected function exportObj($i, $obj) | 
| 103 | 109 |      { | 
| 104 | 110 |          if (array_search($obj, $this->outputObjects, true) !== false) { | 
| @@ -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 |      { |