Passed
Branch master (e714e6)
by Gabriel
13:58 queued 11:36
created

MethodCall::getArgs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Nip\View\Methods\Pipeline;
4
5
use Nip\View;
6
use Nip\View\Traits\MethodsOverloadingTrait;
7
use Nip\View\ViewInterface;
8
9
/**
10
 * Class MethodCall
11
 * @package Nip\View\Methods\Pipeline
12
 */
13
class MethodCall
14
{
15
    /**
16
     * @var View|MethodsOverloadingTrait|ViewInterface
17
     */
18
    private $engine;
19
20
    private $method;
21
22
    private $args;
23
24
    private $return = null;
25
26
    /**
27
     * MethodCall constructor.
28
     * @param ViewInterface|MethodsOverloadingTrait|View $engine
29
     * @param string $method
30
     * @param array $args
31
     */
32 2
    public function __construct($engine, $method, $args)
33
    {
34 2
        $this->engine = $engine;
35 2
        $this->method = $method;
36 2
        $this->args = $args;
37 2
    }
38
39
    /**
40
     * @return View
41
     */
42 2
    public function getEngine()
43
    {
44 2
        return $this->engine;
45
    }
46
47
    /**
48
     * @param mixed $engine
49
     */
50
    public function setEngine($engine): void
51
    {
52
        $this->engine = $engine;
53
    }
54
55
    /**
56
     * @return string
57
     */
58 2
    public function getName()
59
    {
60 2
        return $this->method;
61
    }
62
63
    /**
64
     * @return array
65
     */
66 2
    public function getArgs()
67
    {
68 2
        return $this->args;
69
    }
70
71
    /**
72
     * @return bool
73
     */
74 2
    public function hasReturn()
75
    {
76 2
        return $this->return !== null;
77
    }
78
79
    /**
80
     * @return null
81
     */
82 2
    public function getReturn()
83
    {
84 2
        return $this->return;
85
    }
86
87
    /**
88
     * @param null $return
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $return is correct as it would always require null to be passed?
Loading history...
89
     */
90 2
    public function setReturn($return): void
91
    {
92 2
        $this->return = $return;
93 2
    }
94
}
95