tiles::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 10
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2013 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\views\driver;
11
12
class tiles extends base_view
13
{
14
	/** @var \phpbb\request\request_interface */
15
	protected $request;
16
17
	/**
18
	 * Constructor
19
	 *
20
	 * @param \phpbb\event\dispatcher_interface					$phpbb_dispatcher		Event dispatcher object
21
	 * @param \phpbb\language\language							$language				Language Object
22
	 * @param \phpbb\pagination									$pagination				Pagination object
23
	 * @param \phpbb\template\template							$template				Template object
24
	 * @param \blitze\content\services\fields					$fields					Content fields object
25
	 * @param \blitze\sitemaker\services\forum\data				$forum					Forum Data object
26
	 * @param \blitze\content\services\helper					$helper					Content helper object
27
	 * @param \blitze\content\services\quickmod					$quickmod				Quick moderator tools
28
	 * @param \blitze\content\services\topic\blocks_factory		$topic_blocks_factory	Topic blocks factory object
29
	 * @param \phpbb\request\request_interface					$request				Request object
30
	*/
31
	public function __construct(\phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\language\language $language, \phpbb\pagination $pagination, \phpbb\template\template $template, \blitze\content\services\fields $fields, \blitze\sitemaker\services\forum\data $forum, \blitze\content\services\helper $helper, \blitze\content\services\quickmod $quickmod, \blitze\content\services\topic\blocks_factory $topic_blocks_factory, \phpbb\request\request_interface $request)
0 ignored issues
show
Bug introduced by
The type blitze\sitemaker\services\forum\data was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
32
	{
33
		parent::__construct($phpbb_dispatcher, $language, $pagination, $template, $fields, $forum, $helper, $quickmod, $topic_blocks_factory);
34
35
		$this->request = $request;
36
	}
37
38
	/**
39
	 * @inheritdoc
40
	 */
41
	public function get_name()
42
	{
43
		return 'tiles';
44
	}
45
46
	/**
47
	 * @inheritdoc
48
	 */
49
	public function get_langname()
50
	{
51
		return 'CONTENT_DISPLAY_TILES';
52
	}
53
54
	/**
55
	 * @inheritdoc
56
	 */
57
	public function get_index_template()
58
	{
59
		return 'views/tiles.html';
60
	}
61
62
	/**
63
	 * @inheritdoc
64
	 */
65
	public function render_index(\blitze\content\model\entity\type $entity, $page, array $filters, array $topic_data_overwrite = array(), $cp_mode = '')
66
	{
67
		parent::render_index($entity, $page, $filters);
68
69
		if ($this->request->is_ajax())
70
		{
71
			$this->template->assign_vars(array('S_HIDE_HEADERS' => true));
72
		}
73
	}
74
}
75