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

MethodCall   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 80
Duplicated Lines 0 %

Test Coverage

Coverage 85%

Importance

Changes 0
Metric Value
dl 0
loc 80
ccs 17
cts 20
cp 0.85
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A setEngine() 0 3 1
A hasReturn() 0 3 1
A setReturn() 0 3 1
A getName() 0 3 1
A getEngine() 0 3 1
A __construct() 0 5 1
A getReturn() 0 3 1
A getArgs() 0 3 1
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