action_utils::meta_refresh()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 1
c 1
b 0
f 0
nc 2
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 2
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\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
	/**
21
	 * @param string $u_action
22
	 * @return void
23
	 */
24 1
	protected function redirect($u_action)
25
	{
26 1
		$this->redirect ? redirect($u_action) : null;
27 1
	}
28
29
	/**
30
	 * @param int $time
31
	 * @param string $u_action
32
	 * @return void
33
	 */
34 2
	protected function meta_refresh($time, $u_action)
35
	{
36 2
		$this->auto_refresh ? meta_refresh($time, $u_action) : null;
37 2
	}
38
39
	/**
40
	 * @param string $message
41
	 * @param string $u_action
42
	 * @param int $errno
43
	 * @return void
44
	 */
45 4
	protected function trigger_error($message, $u_action = '', $errno = E_USER_NOTICE)
46
	{
47 4
		$message .= $u_action ? adm_back_link($u_action) : '';
48 4
		trigger_error($message, $errno);
49
	}
50
}
51