Passed
Push — master ( 0db193...9534e6 )
by Rob
04:00
created

References::getInput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace devtoolboxuk\cerberus\Models;
4
5
class References
6
{
7
8
    /**
9
     * @var string
10
     */
11
    private $handler;
12
13
    /**
14
     * @var string
15
     */
16
    private $input;
17
18
    /**
19
     * @var string
20
     */
21
    private $output;
22
23
    private $name;
24
25
    /**
26
     * References constructor.
27
     * @param string $handler
28
     * @param string $input
29
     * @param string $output
30
     * @param string $name
31
     */
32
    function __construct($handler = '', $input = '', $output = '',$name = '')
33
    {
34
        $this->handler = $handler;
35
        $this->name = $name;
36
        $this->input = $input;
37
        $this->output = $output;
38
    }
39
40
    /**
41
     * @return array
42
     */
43
    public function toArray()
44
    {
45
        return [
46
            'handler' => $this->getHandler(),
47
            'reference' => $this->getReference(),
0 ignored issues
show
Bug introduced by
The method getReference() does not exist on devtoolboxuk\cerberus\Models\References. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

47
            'reference' => $this->/** @scrutinizer ignore-call */ getReference(),

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
48
            'input' => $this->getInput(),
49
            'output' => $this->getOutput()
50
        ];
51
    }
52
53
    public function getName()
54
    {
55
56
        if ($this->name) {
57
            return $this->name;
58
        }
59
        return $this->getHandler();
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getHandler()
66
    {
67
        return $this->handler;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getInput()
74
    {
75
        return $this->input;
76
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function getOutput()
82
    {
83
        return $this->output;
84
    }
85
86
}