Completed
Push — master ( f0cf24...757a85 )
by Dmitrij
9s
created

HasArguments   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 19
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A check() 0 10 2
A __construct() 0 3 1
1
<?php
2
3
namespace HotRodCli\Checkers\Container;
4
5
use HotRodCli\Checkers\BaseChecker;
6
use HotRodCli\Checkers\BaseStatus;
7
8
class HasArguments extends BaseChecker
9
{
10
    protected $args;
11
12
    public function __construct($args)
13
    {
14
        $this->args = $args;
15
    }
16
17
    public function check(BaseStatus $status)
18
    {
19
        if (!is_null($this->args)) {
20
            $status->setFailedWith(HasArguments::class);
21
            $status->setStatus(false);
22
23
            return $status;
24
        }
25
26
        return $this->next($status);
27
    }
28
}
29