admin_controller::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
/**
3
 *
4
 * @package sitemaker
5
 * @copyright (c) 2016 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\controller;
11
12
class admin_controller
13
{
14
	/** @var \phpbb\language\language */
15
	protected $language;
16
17
	/** @var \blitze\content\services\actions\action_handler */
18
	protected $action_handler;
19
20
	/**
21
	 * Constructor
22
	 *
23
	 * @param \phpbb\language\language							$language			Language object
24
	 * @param \blitze\content\services\actions\action_handler	$action_handler		Handles actions
25
	*/
26 1
	public function __construct(\phpbb\language\language $language, \blitze\content\services\actions\action_handler $action_handler)
27
	{
28 1
		$this->language = $language;
29 1
		$this->action_handler = $action_handler;
30 1
	}
31
32
	/**
33
	 * Handle admin actions
34
	 *
35
	 * @param string $action
36
	 * @param string $type
37
	 * @param string $base_url
38
	 * @return void
39
	 */
40 1
	public function handle($action, $type, $base_url)
41
	{
42 1
		$this->language->add_lang('admin', 'blitze/content');
43
44
		try
45
		{
46 1
			$command = $this->action_handler->create('type', $action);
47 1
			$command->execute($base_url, $type);
48
		}
49 1
		catch (\blitze\sitemaker\exception\base $e)
0 ignored issues
show
Bug introduced by
The type blitze\sitemaker\exception\base 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...
50
		{
51 1
			$message = $e->get_message($this->language);
52 1
			trigger_error($this->language->lang($message) . adm_back_link($base_url), E_USER_WARNING);
53
		}
54 1
	}
55
}
56