From 7281342de07b43e7ac968be73e50230003ed218d Mon Sep 17 00:00:00 2001 From: Tim van Dijen <tvdijen@gmail.com> Date: Thu, 4 Jan 2018 12:07:01 +0100 Subject: [PATCH] statistics: remove unused methods + phpdoc --- modules/statistics/lib/LogParser.php | 47 +++++++++++++++++----------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/modules/statistics/lib/LogParser.php b/modules/statistics/lib/LogParser.php index 6ca677a38..516c56c93 100644 --- a/modules/statistics/lib/LogParser.php +++ b/modules/statistics/lib/LogParser.php @@ -5,16 +5,27 @@ */ class sspmod_statistics_LogParser { + /** + * @var integer + */ private $datestart; + + /** + * @var integer + */ private $datelength; + + /** + * @var integer + */ private $offset; /** * Constructor * - * @param $datestart At which char is the date starting - * @param $datelength How many characters is the date (on the b - * @param $offset At which char is the rest of the entries starting + * @param integer $datestart At which char is the date starting + * @param integer $datelength How many characters is the date (on the b + * @param integer $offset At which char is the rest of the entries starting */ public function __construct($datestart, $datelength, $offset) { @@ -23,6 +34,12 @@ class sspmod_statistics_LogParser $this->offset = $offset; } + + /** + * @param string $line + * + * @return integer + */ public function parseEpoch($line) { $epoch = strtotime(substr($line, 0, $this->datelength)); @@ -43,24 +60,16 @@ class sspmod_statistics_LogParser return $epoch; } - public function parseContent($line) { + + /** + * @param string $line + * + * @return array + */ + public function parseContent($line) + { $contentstr = substr($line, $this->offset); $content = explode(' ', $contentstr); return $content; } - - // Aug 27 12:54:25 ssp 5 STAT [5416262207] saml20-sp-SSO urn:mace:feide.no:services:no.uninett.wiki-feide sam.feide.no NA - // - // Oct 30 11:07:14 www1 simplesamlphp-foodle[12677]: 5 STAT [200b4679af] saml20-sp-SLO spinit urn:mace:feide.no:services:no.feide.foodle sam.feide.no - - function parse15($str) { - $di = date_parse($str); - $datestamp = mktime($di['hour'], $di['minute'], $di['second'], $di['month'], $di['day']); - return $datestamp; - } - - function parse23($str) { - $timestamp = strtotime($str); - return $timestamp; - } } -- GitLab