From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 03:34:17 +0200 Subject: scrutinizer documentations issues --- inc/cache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index 6817e771b..191d54e45 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -316,7 +316,7 @@ class cache_instructions extends cache_parser { * retrieve the cached data * * @param bool $clean true to clean line endings, false to leave line endings alone - * @return string cache contents + * @return array cache contents */ public function retrieveCache($clean=true) { $contents = io_readFile($this->cache, false); @@ -326,7 +326,7 @@ class cache_instructions extends cache_parser { /** * cache $instructions * - * @param string $instructions the instruction to be cached + * @param array $instructions the instruction to be cached * @return bool true on success, false otherwise */ public function storeCache($instructions) { -- cgit v1.2.3 From 8fed17ed0ecc7e7c3b51762e09d88280a17a33cd Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Wed, 3 Dec 2014 00:06:18 +0100 Subject: code formatting cache --- inc/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index 6817e771b..064174fc7 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -50,7 +50,7 @@ class cache { $this->_addDependencies(); if ($this->_event) { - return $this->_stats(trigger_event($this->_event,$this,array($this,'_useCache'))); + return $this->_stats(trigger_event($this->_event, $this, array($this,'_useCache'))); } else { return $this->_stats($this->_useCache()); } -- cgit v1.2.3 From 79e79377626799a77c11aa7849cb9c64305590c8 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 7 Jan 2015 10:47:45 +0100 Subject: Remove error supression for file_exists() In an older version of PHP a file_exists() call would issue a warning when the file did not exist. This was fixed in later PHP releases. Since we require PHP 5.3 now, there's no need to supress any error here anymore. This might even give a minor performance boost. --- inc/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index edf394134..68f64eaa2 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -203,7 +203,7 @@ class cache_parser extends cache { */ public function _useCache() { - if (!@file_exists($this->file)) return false; // source exists? + if (!file_exists($this->file)) return false; // source exists? return parent::_useCache(); } -- cgit v1.2.3 From 5c3b310dea6f5a4712e4b9bc1f3d6d198c057ee0 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Fri, 15 May 2015 19:32:40 +0200 Subject: more class constructors to __construct() --- inc/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index 68f64eaa2..1776d94cd 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -26,7 +26,7 @@ class cache { * @param string $key primary identifier * @param string $ext file extension */ - public function cache($key,$ext) { + public function __construct($key,$ext) { $this->key = $key; $this->ext = $ext; $this->cache = getCacheName($key,$ext); -- cgit v1.2.3 From 1cb97a10e626bb48eb809e12d0fadea1e1cea7da Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Fri, 15 May 2015 19:41:15 +0200 Subject: update parent constructor calls to use __construct() --- inc/cache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index 1776d94cd..35d9cfd43 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -193,7 +193,7 @@ class cache_parser extends cache { $this->file = $file; $this->mode = $mode; - parent::cache($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode); + parent::__construct($file.$_SERVER['HTTP_HOST'].$_SERVER['SERVER_PORT'],'.'.$mode); } /** @@ -309,7 +309,7 @@ class cache_instructions extends cache_parser { * @param string $file source file for cache */ public function cache_instructions($id, $file) { - parent::cache_parser($id, $file, 'i'); + parent::__construct($id, $file, 'i'); } /** -- cgit v1.2.3 From 2863d10380f6ac5a00868d7125b535a7dc38cb08 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Fri, 15 May 2015 19:59:24 +0200 Subject: another class_name to __construct --- inc/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index 35d9cfd43..6b05a2b54 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -188,7 +188,7 @@ class cache_parser extends cache { * @param string $file source file for cache * @param string $mode input mode */ - public function cache_parser($id, $file, $mode) { + public function __construct($id, $file, $mode) { if ($id) $this->page = $id; $this->file = $file; $this->mode = $mode; -- cgit v1.2.3 From 79eec18f7ad9126ba147cd13eb2a8d6ee41bf140 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 16 May 2015 00:12:29 +0200 Subject: yet another class constructor --- inc/cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/cache.php') diff --git a/inc/cache.php b/inc/cache.php index 6b05a2b54..9375dc86b 100644 --- a/inc/cache.php +++ b/inc/cache.php @@ -308,7 +308,7 @@ class cache_instructions extends cache_parser { * @param string $id page id * @param string $file source file for cache */ - public function cache_instructions($id, $file) { + public function __construct($id, $file) { parent::__construct($id, $file, 'i'); } -- cgit v1.2.3