Issues (49)

controller/acp_controller.php (6 issues)

Labels
Severity
1
<?php
2
/**
3
 *
4
 * Topic Preview
5
 *
6
 * @copyright (c) 2013, 2016 Matt Friedman
7
 * @license GNU General Public License, version 2 (GPL-2.0)
8
 *
9
 */
10
11
namespace vse\topicpreview\controller;
12
13
use phpbb\language\language;
0 ignored issues
show
The type phpbb\language\language 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...
14
use phpbb\request\request;
0 ignored issues
show
The type phpbb\request\request 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...
15
use phpbb\template\template;
0 ignored issues
show
The type phpbb\template\template 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...
16
use vse\topicpreview\core\settings;
17
18
class acp_controller implements acp_controller_interface
19
{
20
	/** @var language */
21
	protected $language;
22
23
	/** @var request */
24
	protected $request;
25
26
	/** @var settings */
27
	protected $settings;
28
29
	/** @var template */
30
	protected $template;
31
32
	/** @var string */
33
	protected $u_action;
34
35
	/**
36
	 * Constructor
37
	 *
38
	 * @param language $language
39
	 * @param request  $request
40
	 * @param settings $settings
41
	 * @param template $template
42
	 */
43 3
	public function __construct(language $language, request $request, settings $settings, template $template)
44
	{
45 3
		$this->language = $language;
46 3
		$this->request = $request;
47 3
		$this->settings = $settings;
48 3
		$this->template = $template;
49 3
	}
50
51
	/**
52
	 * @inheritdoc
53
	 */
54 3
	public function handle()
55
	{
56 3
		$this->language->add_lang('topic_preview_acp', 'vse/topicpreview');
57
58 3
		$form_key = 'acp_topic_preview';
59 3
		add_form_key($form_key);
0 ignored issues
show
The function add_form_key was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

59
		/** @scrutinizer ignore-call */ 
60
  add_form_key($form_key);
Loading history...
60
61 3
		if ($this->request->is_set_post('submit'))
62 3
		{
63 2
			if (!check_form_key($form_key))
0 ignored issues
show
The function check_form_key was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

63
			if (!/** @scrutinizer ignore-call */ check_form_key($form_key))
Loading history...
64 2
			{
65 1
				trigger_error($this->language->lang('FORM_INVALID') . adm_back_link($this->u_action), E_USER_WARNING);
0 ignored issues
show
The function adm_back_link was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

65
				trigger_error($this->language->lang('FORM_INVALID') . /** @scrutinizer ignore-call */ adm_back_link($this->u_action), E_USER_WARNING);
Loading history...
66
			}
67
68 1
			$this->settings->set_settings();
69
70 1
			trigger_error($this->language->lang('CONFIG_UPDATED') . adm_back_link($this->u_action));
71
		}
72
73 1
		$this->template->assign_vars($this->settings->display_settings($this->u_action));
74 1
	}
75
76
	/**
77
	 * @inheritdoc
78
	 */
79 2
	public function set_u_action($u_action)
80 1
	{
81 2
		$this->u_action = $u_action;
82 2
		return $this;
83 1
	}
84
}
85