Passed
Push — develop ( 73b4e9...8d0058 )
by Daniel
05:19
created

action_utils   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 37
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A redirect() 0 3 2
A meta_refresh() 0 3 2
A trigger_error() 0 4 2
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;
0 ignored issues
show
Bug introduced by
The function redirect 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

26
		$this->redirect ? /** @scrutinizer ignore-call */ redirect($u_action) : null;
Loading history...
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;
0 ignored issues
show
Bug introduced by
The function meta_refresh 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

36
		$this->auto_refresh ? /** @scrutinizer ignore-call */ meta_refresh($time, $u_action) : null;
Loading history...
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) : '';
0 ignored issues
show
Bug introduced by
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

47
		$message .= $u_action ? /** @scrutinizer ignore-call */ adm_back_link($u_action) : '';
Loading history...
48 4
		trigger_error($message, $errno);
49
	}
50
}
51