Passed
Push — master ( 9c88e8...27f52c )
by Iman
03:38
created

YouShouldHave::youShouldAlways()   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
eloc 1
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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 97
    public function __call($method, $args)
14
    {
15 97
        resolve(Chain::class)->condition = app(ConditionsFacade::class)->$method(...$args);
16
17 97
        return resolve(Otherwise::class);
18
    }
19
20 68
    public function always()
21
    {
22 68
        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
    }
24
}
25