summaryrefslogtreecommitdiff
path: root/demo
diff options
context:
space:
mode:
authorSławomir Kaleta <slaszka@gmail.com>2018-06-12 09:58:15 +0200
committerSławomir Kaleta <slaszka@gmail.com>2018-06-12 09:58:15 +0200
commit240409578349843bd8467ea6a2083b564baa135d (patch)
tree70c5d4d621d0b2ef394c7d13f445ad471b224da7 /demo
parentcc4d8fa1a07e18f00951a921041e37c87015dcb2 (diff)
downloadsmarty-240409578349843bd8467ea6a2083b564baa135d.tar.gz
smarty-240409578349843bd8467ea6a2083b564baa135d.tar.bz2
smarty-240409578349843bd8467ea6a2083b564baa135d.zip
Update PSR-2
Diffstat (limited to 'demo')
-rw-r--r--demo/index.php12
-rw-r--r--demo/plugins/cacheresource.apc.php8
-rw-r--r--demo/plugins/cacheresource.memcache.php8
-rw-r--r--demo/plugins/cacheresource.mysql.php52
-rw-r--r--demo/plugins/cacheresource.pdo.php30
-rw-r--r--demo/plugins/cacheresource.pdo_gzip.php2
-rw-r--r--demo/plugins/resource.extendsall.php4
-rw-r--r--demo/plugins/resource.mysql.php8
-rw-r--r--demo/plugins/resource.mysqls.php6
9 files changed, 69 insertions, 61 deletions
diff --git a/demo/index.php b/demo/index.php
index b67c217b..9db5ce03 100644
--- a/demo/index.php
+++ b/demo/index.php
@@ -17,11 +17,15 @@ $smarty->cache_lifetime = 120;
$smarty->assign("Name", "Fred Irving Johnathan Bradley Peppergill", true);
$smarty->assign("FirstName", array("John", "Mary", "James", "Henry"));
$smarty->assign("LastName", array("Doe", "Smith", "Johnson", "Case"));
-$smarty->assign("Class", array(array("A", "B", "C", "D"), array("E", "F", "G", "H"), array("I", "J", "K", "L"),
- array("M", "N", "O", "P")));
+$smarty->assign(
+ "Class", array(array("A", "B", "C", "D"), array("E", "F", "G", "H"), array("I", "J", "K", "L"),
+ array("M", "N", "O", "P"))
+);
-$smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
- array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
+$smarty->assign(
+ "contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
+ array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234"))
+);
$smarty->assign("option_values", array("NY", "NE", "KS", "IA", "OK", "TX"));
$smarty->assign("option_output", array("New York", "Nebraska", "Kansas", "Iowa", "Oklahoma", "Texas"));
diff --git a/demo/plugins/cacheresource.apc.php b/demo/plugins/cacheresource.apc.php
index ed55ec84..dec18a29 100644
--- a/demo/plugins/cacheresource.apc.php
+++ b/demo/plugins/cacheresource.apc.php
@@ -22,7 +22,7 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore
/**
* Read values for a set of keys from cache
*
- * @param array $keys list of keys to fetch
+ * @param array $keys list of keys to fetch
*
* @return array list of values with the given keys used as indexes
* @return boolean true on success, false on failure
@@ -41,8 +41,8 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore
/**
* Save values for a set of keys to cache
*
- * @param array $keys list of values to save
- * @param int $expire expiration time
+ * @param array $keys list of values to save
+ * @param int $expire expiration time
*
* @return boolean true on success, false on failure
*/
@@ -58,7 +58,7 @@ class Smarty_CacheResource_Apc extends Smarty_CacheResource_KeyValueStore
/**
* Remove values from cache
*
- * @param array $keys list of keys to delete
+ * @param array $keys list of keys to delete
*
* @return boolean true on success, false on failure
*/
diff --git a/demo/plugins/cacheresource.memcache.php b/demo/plugins/cacheresource.memcache.php
index 945beb34..189579bb 100644
--- a/demo/plugins/cacheresource.memcache.php
+++ b/demo/plugins/cacheresource.memcache.php
@@ -32,7 +32,7 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
/**
* Read values for a set of keys from cache
*
- * @param array $keys list of keys to fetch
+ * @param array $keys list of keys to fetch
*
* @return array list of values with the given keys used as indexes
* @return boolean true on success, false on failure
@@ -57,8 +57,8 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
/**
* Save values for a set of keys to cache
*
- * @param array $keys list of values to save
- * @param int $expire expiration time
+ * @param array $keys list of values to save
+ * @param int $expire expiration time
*
* @return boolean true on success, false on failure
*/
@@ -75,7 +75,7 @@ class Smarty_CacheResource_Memcache extends Smarty_CacheResource_KeyValueStore
/**
* Remove values from cache
*
- * @param array $keys list of keys to delete
+ * @param array $keys list of keys to delete
*
* @return boolean true on success, false on failure
*/
diff --git a/demo/plugins/cacheresource.mysql.php b/demo/plugins/cacheresource.mysql.php
index 027b9376..ff8e6f54 100644
--- a/demo/plugins/cacheresource.mysql.php
+++ b/demo/plugins/cacheresource.mysql.php
@@ -43,19 +43,21 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
}
$this->fetch = $this->db->prepare('SELECT modified, content FROM output_cache WHERE id = :id');
$this->fetchTimestamp = $this->db->prepare('SELECT modified FROM output_cache WHERE id = :id');
- $this->save = $this->db->prepare('REPLACE INTO output_cache (id, name, cache_id, compile_id, content)
- VALUES (:id, :name, :cache_id, :compile_id, :content)');
+ $this->save = $this->db->prepare(
+ 'REPLACE INTO output_cache (id, name, cache_id, compile_id, content)
+ VALUES (:id, :name, :cache_id, :compile_id, :content)'
+ );
}
/**
* fetch cached content and its modification time from data source
*
- * @param string $id unique cache content identifier
- * @param string $name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
- * @param string $content cached content
- * @param integer $mtime cache modification timestamp (epoch)
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param string $content cached content
+ * @param integer $mtime cache modification timestamp (epoch)
*
* @return void
*/
@@ -78,10 +80,10 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
*
* @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the complete cached content.
*
- * @param string $id unique cache content identifier
- * @param string $name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
*
* @return integer|boolean timestamp (epoch) the template was modified, or false if not found
*/
@@ -97,19 +99,21 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
/**
* Save content to cache
*
- * @param string $id unique cache content identifier
- * @param string $name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
- * @param integer|null $exp_time seconds till expiration time in seconds or null
- * @param string $content content to cache
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer|null $exp_time seconds till expiration time in seconds or null
+ * @param string $content content to cache
*
* @return boolean success
*/
protected function save($id, $name, $cache_id, $compile_id, $exp_time, $content)
{
- $this->save->execute(array('id' => $id, 'name' => $name, 'cache_id' => $cache_id, 'compile_id' => $compile_id,
- 'content' => $content,));
+ $this->save->execute(
+ array('id' => $id, 'name' => $name, 'cache_id' => $cache_id, 'compile_id' => $compile_id,
+ 'content' => $content,)
+ );
return !!$this->save->rowCount();
}
@@ -117,10 +121,10 @@ class Smarty_CacheResource_Mysql extends Smarty_CacheResource_Custom
/**
* Delete content from cache
*
- * @param string $name template name
- * @param string $cache_id cache id
- * @param string $compile_id compile id
- * @param integer|null $exp_time seconds till expiration or null
+ * @param string $name template name
+ * @param string $cache_id cache id
+ * @param string $compile_id compile id
+ * @param integer|null $exp_time seconds till expiration or null
*
* @return integer number of deleted caches
*/
diff --git a/demo/plugins/cacheresource.pdo.php b/demo/plugins/cacheresource.pdo.php
index 24a94c1a..5d9a132b 100644
--- a/demo/plugins/cacheresource.pdo.php
+++ b/demo/plugins/cacheresource.pdo.php
@@ -165,12 +165,12 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom
/**
* fetch cached content and its modification time from data source
*
- * @param string $id unique cache content identifier
- * @param string $name template name
- * @param string|null $cache_id cache id
- * @param string|null $compile_id compile id
- * @param string $content cached content
- * @param integer $mtime cache modification timestamp (epoch)
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string|null $cache_id cache id
+ * @param string|null $compile_id compile id
+ * @param string $content cached content
+ * @param integer $mtime cache modification timestamp (epoch)
*
* @return void
* @access protected
@@ -197,10 +197,10 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom
* {@internal implementing this method is optional.
* Only implement it if modification times can be accessed faster than loading the complete cached content.}}
*
- * @param string $id unique cache content identifier
- * @param string $name template name
- * @param string|null $cache_id cache id
- * @param string|null $compile_id compile id
+ * @param string $id unique cache content identifier
+ * @param string $name template name
+ * @param string|null $cache_id cache id
+ * @param string|null $compile_id compile id
*
* @return integer|boolean timestamp (epoch) the template was modified, or false if not found
* @access protected
@@ -269,10 +269,10 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom
/**
* Delete content from cache
*
- * @param string|null $name template name
- * @param string|null $cache_id cache id
- * @param string|null $compile_id compile id
- * @param integer|null|-1 $exp_time seconds till expiration or null
+ * @param string|null $name template name
+ * @param string|null $cache_id cache id
+ * @param string|null $compile_id compile id
+ * @param integer|null|-1 $exp_time seconds till expiration or null
*
* @return integer number of deleted caches
* @access protected
@@ -324,4 +324,4 @@ class Smarty_CacheResource_Pdo extends Smarty_CacheResource_Custom
return (is_null($this->database)) ? "`{$this->table}`" : "`{$this->database}`.`{$this->table}`";
}
}
- \ No newline at end of file
+
diff --git a/demo/plugins/cacheresource.pdo_gzip.php b/demo/plugins/cacheresource.pdo_gzip.php
index 8a9e0a5d..72427c4c 100644
--- a/demo/plugins/cacheresource.pdo_gzip.php
+++ b/demo/plugins/cacheresource.pdo_gzip.php
@@ -40,4 +40,4 @@ class Smarty_CacheResource_Pdo_Gzip extends Smarty_CacheResource_Pdo
return gzinflate($content);
}
}
- \ No newline at end of file
+
diff --git a/demo/plugins/resource.extendsall.php b/demo/plugins/resource.extendsall.php
index a5ee432d..33936297 100644
--- a/demo/plugins/resource.extendsall.php
+++ b/demo/plugins/resource.extendsall.php
@@ -13,8 +13,8 @@ class Smarty_Resource_Extendsall extends Smarty_Internal_Resource_Extends
/**
* populate Source Object with meta data from Resource
*
- * @param Smarty_Template_Source $source source object
- * @param Smarty_Internal_Template $_template template object
+ * @param Smarty_Template_Source $source source object
+ * @param Smarty_Internal_Template $_template template object
*
* @return void
*/
diff --git a/demo/plugins/resource.mysql.php b/demo/plugins/resource.mysql.php
index 619707e7..f21ba8dc 100644
--- a/demo/plugins/resource.mysql.php
+++ b/demo/plugins/resource.mysql.php
@@ -43,9 +43,9 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom
/**
* Fetch a template and its modification time from database
*
- * @param string $name template name
- * @param string $source template source
- * @param integer $mtime template modification timestamp (epoch)
+ * @param string $name template name
+ * @param string $source template source
+ * @param integer $mtime template modification timestamp (epoch)
*
* @return void
*/
@@ -68,7 +68,7 @@ class Smarty_Resource_Mysql extends Smarty_Resource_Custom
*
* @note implementing this method is optional. Only implement it if modification times can be accessed faster than loading the comple template source.
*
- * @param string $name template name
+ * @param string $name template name
*
* @return integer timestamp (epoch) the template was modified
*/
diff --git a/demo/plugins/resource.mysqls.php b/demo/plugins/resource.mysqls.php
index d85aecf3..3e866830 100644
--- a/demo/plugins/resource.mysqls.php
+++ b/demo/plugins/resource.mysqls.php
@@ -41,9 +41,9 @@ class Smarty_Resource_Mysqls extends Smarty_Resource_Custom
/**
* Fetch a template and its modification time from database
*
- * @param string $name template name
- * @param string $source template source
- * @param integer $mtime template modification timestamp (epoch)
+ * @param string $name template name
+ * @param string $source template source
+ * @param integer $mtime template modification timestamp (epoch)
*
* @return void
*/