Completed
Pull Request — master (#50)
by Iman
11:43 queued 08:37
created

YouShouldHave   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
eloc 6
dl 0
loc 16
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __call() 0 5 1
A youShouldAlways() 0 3 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 3
    public function youShouldAlways()
21
    {
22 3
        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