Completed
Push — develop ( 69e1c6...6a0b8a )
by Daniel
08:16
created

action_utils::trigger_error()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 3

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 3
nc 4
nop 3
crap 3
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\services\actions;
11
12
abstract class action_utils
13
{
14
	/** @var bool */
15
	protected $auto_refresh = true;
16
17
	/** @var bool */
18
	protected $redirect = true;
19
20
	/** @var bool */
21
	protected $trigger_error = true;
22
23
	/**
24
	 * @param string $u_action
25
	 * @return void
26
	 */
27 1
	protected function redirect($u_action)
28
	{
29 1
		$this->redirect ? redirect($u_action) : null;
30 1
	}
31
32
	/**
33
	 * @param int $time
34
	 * @param string $u_action
35
	 * @return void
36
	 */
37 2
	protected function meta_refresh($time, $u_action)
0 ignored issues
show
Unused Code introduced by
The parameter $time is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
38
	{
39 2
		$this->auto_refresh ? meta_refresh(3, $u_action) : null;
40 2
	}
41
42
	/**
43
	 * @param string $message
44
	 * @param string $u_action
45
	 * @param int $errno
46
	 * @return void
47
	 */
48 3
	protected function trigger_error($message, $u_action = '', $errno = E_USER_WARNING)
49
	{
50 3
		$message .= $u_action ? adm_back_link($u_action) : '';
51 3
		$this->trigger_error ? trigger_error($message, $errno) : null;
52 3
	}
53
}
54