ErrorHandlerTrait::setError()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 1
eloc 5
nc 1
nop 2
1
<?php
2
3
/*
4
 *  @author Serkin Akexander <[email protected]>
5
 */
6
7
namespace Volan\Traits;
8
9
trait ErrorHandlerTrait
10
{
11
12
    /**
13
     * @var array
14
     */
15
    private $error;
16
17
    /**
18
     * @return array
19
     */
20
    public function getErrorInfo()
21
    {
22
        return $this->error;
23
    }
24
25
    abstract public function getCurrentNode();
26
27
28
    /**
29
     * @param string $message
30
     * @param int    $code
31
     */
32
    private function setError($message, $code)
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
33
    {
34
        $this->error = [
35
            'code'  => $code,
36
            'error' => $message,
37
            'node'  => $this->getCurrentNode()
38
                ];
39
    }
40
}
41