From bdc5152d486ca75372c271f94623b248bc127800 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Sun, 2 Dec 2018 23:24:58 +0100 Subject: namespacing: \Shaarli\History Signed-off-by: VirtualTam --- application/History.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'application/History.php') diff --git a/application/History.php b/application/History.php index 35ec016a..8074a017 100644 --- a/application/History.php +++ b/application/History.php @@ -1,4 +1,9 @@ historyFilePath)) { + if (!is_file($this->historyFilePath)) { FileUtils::writeFlatDB($this->historyFilePath, []); } - if (! is_writable($this->historyFilePath)) { + if (!is_writable($this->historyFilePath)) { throw new Exception(t('History file isn\'t readable or writable')); } } @@ -191,7 +196,7 @@ class History */ protected function write() { - $comparaison = new DateTime('-'. $this->retentionTime . ' seconds'); + $comparaison = new DateTime('-' . $this->retentionTime . ' seconds'); foreach ($this->history as $key => $value) { if ($value['datetime'] < $comparaison) { unset($this->history[$key]); -- cgit v1.2.3 From a0c4dbd91c41b9ecdd5176c1ac33b55e240d2392 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Mon, 3 Dec 2018 00:59:21 +0100 Subject: namespacing: \Shaarli\FileUtils Signed-off-by: VirtualTam --- application/History.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'application/History.php') diff --git a/application/History.php b/application/History.php index 8074a017..a5846652 100644 --- a/application/History.php +++ b/application/History.php @@ -3,7 +3,6 @@ namespace Shaarli; use DateTime; use Exception; -use FileUtils; /** * Class History @@ -71,7 +70,7 @@ class History * History constructor. * * @param string $historyFilePath History file path. - * @param int $retentionTime History content rentention time in seconds. + * @param int $retentionTime History content retention time in seconds. * * @throws Exception if something goes wrong. */ @@ -146,7 +145,7 @@ class History * Save a new event and write it in the history file. * * @param string $status Event key, should be defined as constant. - * @param mixed $id Event item identifier (e.g. link ID). + * @param mixed $id Event item identifier (e.g. link ID). */ protected function addEvent($status, $id = null) { -- cgit v1.2.3