Abort   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 13
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A abortIt() 0 4 1
A abort() 0 5 1
1
<?php
2
3
namespace Imanghafoori\HeyMan\Plugins\Reactions;
4
5
use Imanghafoori\HeyMan\Core\BaseReaction;
6
use Imanghafoori\HeyMan\Reactions\Then;
7
8
class Abort extends BaseReaction
9
{
10 2
    public function abort($code, string $message = null, array $headers = [])
11
    {
12 2
        $this->commit(func_get_args(), [static::class, 'abortIt']);
13
14 2
        return new Then($this);
15
    }
16
17
    public static function abortIt($args)
18
    {
19 2
        return function () use ($args) {
20 2
            app()->abort(...$args);
0 ignored issues
show
introduced by
The method abort() does not exist on Illuminate\Container\Container. Are you sure you never get this type here, but always one of the subclasses? ( Ignorable by Annotation )

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

20
            app()->/** @scrutinizer ignore-call */ abort(...$args);
Loading history...
21 2
        };
22
    }
23
}
24