Completed
Push — master ( ecba64...32cb15 )
by Alexander
06:35 queued 03:11
created

BaseErrorHandler::getVars()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Base class for error handlers
4
 *
5
 * @file      BaseErrorHandler.php
6
 *
7
 * PHP version 5.4+
8
 *
9
 * @author    Yancharuk Alexander <alex at itvault dot info>
10
 * @copyright © 2012-2015 Alexander Yancharuk <alex at itvault at info>
11
 * @date      2015-08-10 10:07
12
 * @license   The BSD 3-Clause License
13
 *            <https://tldrlegal.com/license/bsd-3-clause-license-(revised)>
14
 */
15
16
namespace Veles\ErrorHandler;
17
18
use Veles\Helpers\Observable;
19
20
/**
21
 * Class BaseErrorHandler
22
 * @author  Yancharuk Alexander <alex at itvault dot info>
23
 */
24
class BaseErrorHandler extends Observable
25
{
26
	/** @var array */
27
	protected $vars = [];
28
	/** @var  string */
29
	protected $time;
30
31
	/**
32
	 * Get error variables
33
	 *
34
	 * @return array
35
	 */
36 1
	public function getVars()
37
	{
38 1
		return $this->vars;
39
	}
40
41
	/**
42
	 * @return string
43
	 */
44 2
	public function getTime()
45
	{
46 2
		if (null === $this->time) {
47 1
			$this->time = strftime('%Y-%m-%d %H:%M:%S', time());
48 1
		}
49
50 2
		return $this->time;
51
	}
52
53
	/**
54
	 * @param string $time
55
	 *
56
	 * @return $this
57
	 */
58 2
	public function setTime($time)
59
	{
60 2
		$this->time = $time;
61
62 2
		return $this;
63
	}
64
}
65