From 3f230b1a8c716adb77b679fed91d50c391387b19 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Fri, 26 Jul 2013 12:29:49 -0500 Subject: [ticket/11744] Create null log class (primarily for unit test) PHPBB3-11744 --- phpBB/phpbb/log/null.php | 125 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 phpBB/phpbb/log/null.php (limited to 'phpBB/phpbb/log/null.php') diff --git a/phpBB/phpbb/log/null.php b/phpBB/phpbb/log/null.php new file mode 100644 index 0000000000..9837058ef5 --- /dev/null +++ b/phpBB/phpbb/log/null.php @@ -0,0 +1,125 @@ + Date: Sun, 28 Jul 2013 21:10:17 -0500 Subject: [ticket/11744] Inheritdoc PHPBB3-11744 --- phpBB/phpbb/log/null.php | 61 ++++++------------------------------------------ 1 file changed, 7 insertions(+), 54 deletions(-) (limited to 'phpBB/phpbb/log/null.php') diff --git a/phpBB/phpbb/log/null.php b/phpBB/phpbb/log/null.php index 9837058ef5..14b5f65eec 100644 --- a/phpBB/phpbb/log/null.php +++ b/phpBB/phpbb/log/null.php @@ -23,12 +23,7 @@ if (!defined('IN_PHPBB')) class phpbb_log_null implements phpbb_log_interface { /** - * This function returns the state of the log system. - * - * @param string $type The log type we want to check. Empty to get - * global log status. - * - * @return bool True if log for the type is enabled + * {@inheritdoc} */ public function is_enabled($type = '') { @@ -36,46 +31,21 @@ class phpbb_log_null implements phpbb_log_interface } /** - * Disable log - * - * This function allows disabling the log system or parts of it, for this - * page call. When add_log is called and the type is disabled, - * the log will not be added to the database. - * - * @param mixed $type The log type we want to disable. Empty to - * disable all logs. Can also be an array of types. - * - * @return null + * {@inheritdoc} */ public function disable($type = '') { } /** - * Enable log - * - * This function allows re-enabling the log system. - * - * @param mixed $type The log type we want to enable. Empty to - * enable all logs. Can also be an array of types. - * - * @return null + * {@inheritdoc} */ public function enable($type = '') { } /** - * Adds a log entry to the database - * - * @param string $mode The mode defines which log_type is used and from which log the entry is retrieved - * @param int $user_id User ID of the user - * @param string $log_ip IP address of the user - * @param string $log_operation Name of the operation - * @param int $log_time Timestamp when the log entry was added, if empty time() will be used - * @param array $additional_data More arguments can be added, depending on the log_type - * - * @return int|bool Returns the log_id, if the entry was added to the database, false otherwise. + * {@inheritdoc} */ public function add($mode, $user_id, $log_ip, $log_operation, $log_time = false, $additional_data = array()) { @@ -83,20 +53,7 @@ class phpbb_log_null implements phpbb_log_interface } /** - * Grab the logs from the database - * - * @param string $mode The mode defines which log_type is used and ifrom which log the entry is retrieved - * @param bool $count_logs Shall we count all matching log entries? - * @param int $limit Limit the number of entries that are returned - * @param int $offset Offset when fetching the log entries, f.e. when paginating - * @param mixed $forum_id Restrict the log entries to the given forum_id (can also be an array of forum_ids) - * @param int $topic_id Restrict the log entries to the given topic_id - * @param int $user_id Restrict the log entries to the given user_id - * @param int $log_time Only get log entries newer than the given timestamp - * @param string $sort_by SQL order option, e.g. 'l.log_time DESC' - * @param string $keywords Will only return log entries that have the keywords in log_operation or log_data - * - * @return array The result array with the logs + * {@inheritdoc} */ public function get_logs($mode, $count_logs = true, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $log_time = 0, $sort_by = 'l.log_time DESC', $keywords = '') { @@ -104,9 +61,7 @@ class phpbb_log_null implements phpbb_log_interface } /** - * Get total log count - * - * @return int Returns the number of matching logs from the last call to get_logs() + * {@inheritdoc} */ public function get_log_count() { @@ -114,9 +69,7 @@ class phpbb_log_null implements phpbb_log_interface } /** - * Get offset of the last valid page - * - * @return int Returns the offset of the last valid page from the last call to get_logs() + * {@inheritdoc} */ public function get_valid_offset() { -- cgit v1.2.1 From 2472271bc0cd7c15c77783c86ccaac643ab1756a Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 16 Sep 2013 02:41:03 +0200 Subject: [ticket/11700] Fix tests after merging new develop code PHPBB3-11700 --- phpBB/phpbb/log/null.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/log/null.php') diff --git a/phpBB/phpbb/log/null.php b/phpBB/phpbb/log/null.php index 14b5f65eec..2ef69926ee 100644 --- a/phpBB/phpbb/log/null.php +++ b/phpBB/phpbb/log/null.php @@ -7,6 +7,8 @@ * */ +namespace phpbb\log; + /** * @ignore */ @@ -20,7 +22,7 @@ if (!defined('IN_PHPBB')) * * @package phpbb_log */ -class phpbb_log_null implements phpbb_log_interface +class null implements log_interface { /** * {@inheritdoc} -- cgit v1.2.1