- PHPdoc updates

This commit is contained in:
uwetews
2015-12-27 08:12:46 +01:00
parent c2f05e8c3c
commit c8c82a292a
13 changed files with 40 additions and 35 deletions

View File

@@ -3,6 +3,7 @@
- improve inheritance code
- update external methods
- code fixes
- PHPdoc updates
25.12.2015
- compile {block} tag code and its processing into classes

View File

@@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.30-dev/10';
const SMARTY_VERSION = '3.1.30-dev/11';
/**
* define variable scopes

View File

@@ -20,10 +20,11 @@ class Smarty_Internal_Compile_Rdelim extends Smarty_Internal_CompileBase
* Compiles code for the {rdelim} tag
* This tag does output the right delimiter.
*
* @param array $args array with attributes from parser
* @param object $compiler compiler object
* @param array $args array with attributes from parser
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
*
* @return string compiled code
* @throws \SmartyCompilerException
*/
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
{

View File

@@ -19,9 +19,9 @@ class Smarty_Internal_Compile_Setfilter extends Smarty_Internal_CompileBase
/**
* Compiles code for setfilter tag
*
* @param array $args array with attributes from parser
* @param object $compiler compiler object
* @param array $parameter array with compilation parameter
* @param array $args array with attributes from parser
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
* @param array $parameter array with compilation parameter
*
* @return string compiled code
*/
@@ -48,8 +48,8 @@ class Smarty_Internal_Compile_Setfilterclose extends Smarty_Internal_CompileBase
* Compiles code for the {/setfilter} tag
* This tag does not generate compiled output. It resets variable filter.
*
* @param array $args array with attributes from parser
* @param object $compiler compiler object
* @param array $args array with attributes from parser
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
*
* @return string compiled code
*/

View File

@@ -22,8 +22,9 @@ class Smarty_Internal_Method_GetGlobal
* Returns a single or all global variables
*
* @api Smarty::getGlobal()
* @param string $varName variable name or null
*
* @param \Smarty_Internal_Data $data
* @param string $varName variable name or null
*
* @return string variable value or or array of variables
*/

View File

@@ -21,12 +21,12 @@ class Smarty_Internal_Method_UnregisterCacheResource
/**
* Registers a resource to fetch a template
*
* @api Smarty::unregisterCacheResource()
* @link http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl
* @api Smarty::unregisterCacheResource()
* @link http://www.smarty.net/docs/en/api.unregister.cacheresource.tpl
*
* @param \Smarty_Internal_TemplateBase|\Smarty_Internal_Template|\Smarty $obj
* @param string $type name of cache resource type
*
* @param $name
*
* @return \Smarty|\Smarty_Internal_Template
*/
public function unregisterCacheResource(Smarty_Internal_TemplateBase $obj, $name)

View File

@@ -13,7 +13,8 @@ class Smarty_Internal_Runtime_CacheModify
/**
* check client side cache
*
* @param Smarty_Internal_Template $_template
* @param \Smarty_Template_Cached $cached
* @param \Smarty_Internal_Template $_template
* @param string $content
*/
public function cacheModifiedCheck(Smarty_Template_Cached $cached, Smarty_Internal_Template $_template, $content)

View File

@@ -144,6 +144,7 @@ class Smarty_Internal_SmartyTemplateCompiler extends Smarty_Internal_TemplateCom
* @param array $parameter optional parameter array
* @param string $key optional key for callback
* @param bool $replace if true replace existing keyed callback
*
*/
public function registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)
{

View File

@@ -119,13 +119,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
/**
* render template
*
* @param bool $merge_tpl_vars if true parent template variables merged in to local scope
* @param bool $no_output_filter if true do not run output filter
* @param bool $display true: display, false: fetch null: subtemplate
* @param null|bool $display true: display, false: fetch null: sub-template
*
* @throws Exception
* @throws SmartyException
* @return string rendered template output
* @return string
* @throws \SmartyException
*/
public function render($no_output_filter = true, $display = null)
{
@@ -166,7 +164,7 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
// display or fetch
if ($display) {
if ($this->caching && $this->smarty->cache_modified_check) {
$this->smarty->ext->_cachemodify->cacheModifiedCheck($this->cached, $this,
$this->smarty->ext->_cacheModify->cacheModifiedCheck($this->cached, $this,
isset($content) ? $content : ob_get_clean());
} else {
if ((!$this->caching || $this->cached->has_nocache_code || $this->source->handler->recompiled) &&
@@ -264,9 +262,6 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
$tpl->cache_id = $cache_id;
$tpl->compile_id = $compile_id;
if (isset($uid)) {
if (isset($tpl->compiled)) {
$tpl->compiled->isInit = false;
}
// for inline templates we can get all resource information from file dependency
if (isset($tpl->compiled->file_dependency[ $uid ])) {
list($filepath, $timestamp, $type) = $tpl->compiled->file_dependency[ $uid ];
@@ -403,10 +398,12 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase
* - Decode saved properties from compiled template and cache files
* - Check if compiled or cache file is valid
*
* @param array $properties special template properties
* @param bool $cache flag if called from cache file
* @param \Smarty_Internal_Template $tpl
* @param array $properties special template properties
* @param bool $cache flag if called from cache file
*
* @return bool flag if compiled or cache file is valid
* @return bool flag if compiled or cache file is valid
* @throws \SmartyException
*/
public function _decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
{

View File

@@ -17,8 +17,8 @@
*
* @property Smarty_Internal_SmartyTemplateCompiler $prefixCompiledCode = ''
* @property Smarty_Internal_SmartyTemplateCompiler $postfixCompiledCode = ''
* @method Smarty_Internal_SmartyTemplateCompiler registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)
* @method Smarty_Internal_SmartyTemplateCompiler unregisterPostCompileCallback($key)
* @method registerPostCompileCallback($callback, $parameter = array(), $key = null, $replace = false)
* @method unregisterPostCompileCallback($key)
*/
abstract class Smarty_Internal_TemplateCompilerBase
{

View File

@@ -20,9 +20,10 @@ class Smarty_Internal_TestInstall
* diagnose Smarty setup
* If $errors is secified, the diagnostic report will be appended to the array, rather than being output.
*
* @param array $errors array to push results into rather than outputting them
* @param \Smarty $smarty
* @param array $errors array to push results into rather than outputting them
*
* @return bool status, true if everything is fine, false else
* @return bool status, true if everything is fine, false else
*/
public static function testInstall(Smarty $smarty, &$errors = null)
{

View File

@@ -17,12 +17,13 @@ class Smarty_Internal_Undefined
* - Decode saved properties from compiled template and cache files
* - Check if compiled or cache file is valid
*
* @param \Smarty_Internal_Template $tpl
* @param array $properties special template properties
* @param bool $cache flag if called from cache file
*
* @return bool flag if compiled or cache file is valid
* @return bool flag if compiled or cache file is valid
*/
public function decodeProperties($tpl, $properties, $cache = false)
public function decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false)
{
if ($cache) {
$tpl->cached->valid = false;

View File

@@ -93,10 +93,11 @@ abstract class Smarty_Template_Resource_Base
*/
abstract public function process(Smarty_Internal_Template $_template);
/**
/**
* get rendered template content by calling compiled or cached template code
*
* @param string $unifunc function with template code
* @param \Smarty_Internal_Template $_template
* @param string $unifunc function with template code
*
* @return string
* @throws \Exception