Completed
Push — master ( eedef1...85765a )
by Gabriel
02:55
created

Command   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 83.33%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 12
c 1
b 0
f 1
dl 0
loc 45
ccs 10
cts 12
cp 0.8333
rs 10
wmc 6

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setReturn() 0 3 1
A hasReturn() 0 3 1
A getString() 0 11 3
A getReturn() 0 3 1
1
<?php
2
3
namespace Nip\Dispatcher\Commands;
4
5
use Nip\Dispatcher\Commands\Traits\HasActionTrait;
6
use Nip\Dispatcher\Commands\Traits\HasResponseTrait;
0 ignored issues
show
Bug introduced by
The type Nip\Dispatcher\Commands\Traits\HasResponseTrait was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Nip\Dispatcher\Traits\HasRequestTrait;
8
9
/**
10
 * Class ActionCall
11
 * @package Nip\Dispatcher\Resolver\Pipeline
12
 */
13
class Command
14
{
15
    use HasRequestTrait;
16
    use HasActionTrait;
17
18
    protected $return = null;
19
20
    /**
21
     * @return string
22
     */
23 1
    public function getString()
24
    {
25 1
        if ($this->hasAction()) {
26
            return print_r($this->getAction(), true);
27
        }
28
29 1
        if ($this->hasRequest()) {
30
            return print_r($this->getRequest()->getMCA(), true);
31
        }
32
33 1
        return print_r($this, true);
34
    }
35
36
    /**
37
     * @return bool
38
     */
39 6
    public function hasReturn()
40
    {
41 6
        return $this->return !== null;
42
    }
43
44
    /**
45
     * @return null
46
     */
47 5
    public function getReturn()
48
    {
49 5
        return $this->return;
50
    }
51
52
    /**
53
     * @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...
54
     */
55 5
    public function setReturn($return)
56
    {
57 5
        $this->return = $return;
58 5
    }
59
}
60