topic_in_queue   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 2
Bugs 1 Features 0
Metric Value
eloc 7
c 2
b 1
f 0
dl 0
loc 37
ccs 0
cts 13
cp 0
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A get_url() 0 8 2
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2017 Daniel A. (blitze)
6
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
7
 *
8
 */
9
10
namespace blitze\content\services\notification;
11
12
/**
13
 * @property int $item_parent_id
14
 * @property int $item_id
15
 */
16
class topic_in_queue extends \phpbb\notification\type\topic_in_queue
17
{
18
	/* @var \blitze\content\services\types */
19
	protected $types;
20
21
	/**
22
	 * Notification Type Base Constructor
23
	 *
24
	 * @param \phpbb\db\driver\driver_interface $db
25
	 * @param \phpbb\language\language          $language
26
	 * @param \phpbb\user                       $user
27
	 * @param \phpbb\auth\auth                  $auth
28
	 * @param string                            $phpbb_root_path
29
	 * @param string                            $php_ext
30
	 * @param string                            $user_notifications_table
31
	 * @param \blitze\content\services\types	$types
32
	 */
33
	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, \phpbb\user $user, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext, $user_notifications_table, \blitze\content\services\types $types)
34
	{
35
		parent::__construct($db, $language, $user, $auth, $phpbb_root_path, $php_ext, $user_notifications_table);
36
37
		$this->types = $types;
38
	}
39
40
	/**
41
	* Get the url to this item
42
	*
43
	* @return string URL
44
	*/
45
	public function get_url()
46
	{
47
		if ($type = $this->types->get_forum_type($this->item_parent_id))
48
		{
49
			return append_sid($this->phpbb_root_path . 'mcp.' . $this->php_ext, "i=-blitze-content-mcp-content_module&amp;mode=content&amp;type=$type&amp;t={$this->item_id}&amp;do=view");
50
		}
51
52
		return parent::get_url();
53
	}
54
}
55