Passed
Push — master ( 54eca1...f21c32 )
by Iman
08:48 queued 10s
created

YouShouldHave::__construct()   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 1
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 Imanghafoori\HeyMan;
4
5
use Imanghafoori\HeyMan\Conditions\ConditionsFacade;
6
7
final class YouShouldHave
8
{
9
    use \Imanghafoori\HeyMan\Conditions\RequestValidation;
10
11
    public $condition;
12
13
    public function __call($method, $args)
14
    {
15
        resolve(Chain::class)->condition = app(ConditionsFacade::class)->$method(...$args);
16
17
        return resolve(Otherwise::class);
18
    }
19
20
    public function youShouldAlways()
21
    {
22
        return $this->thisValueShouldAllow(false)->otherwise();
0 ignored issues
show
Bug introduced by
The method thisValueShouldAllow() does not exist on Imanghafoori\HeyMan\YouShouldHave. Since you implemented __call, consider adding a @method annotation. ( Ignorable by Annotation )

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

22
        return $this->/** @scrutinizer ignore-call */ thisValueShouldAllow(false)->otherwise();
Loading history...
23 102
    }
24
}
25