Forget::__call()   A
last analyzed

Complexity

Conditions 4
Paths 6

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 4

Importance

Changes 0
Metric Value
cc 4
eloc 5
nc 6
nop 2
dl 0
loc 11
ccs 6
cts 6
cp 1
crap 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Imanghafoori\HeyMan\Core;
4
5
/**
6
 * Class Forget.
7
 *
8
 * @method aboutRoute(array|string $routeName)
9
 * @method aboutAction(array|string $action)
10
 * @method aboutUrl(array|string $url)
11
 * @method aboutModel(array|string $model)
12
 * @method aboutDeleting(array|string $model)
13
 * @method aboutSaving(array|string $model)
14
 * @method aboutCreating(array|string $model)
15
 * @method aboutUpdating(array|string $model)
16
 * @method aboutFetching(array|string $model)
17
 */
18
final class Forget
19
{
20
    public static $situationProviders;
21
22 14
    public function __call($method, $args)
23
    {
24 14
        $args = is_array($args[0]) ? $args[0] : $args;
25
26 14
        foreach (static::$situationProviders as $class) {
27 14
            if (in_array($method, $class::getForgetMethods())) {
28 14
                $args = $class::getForgetArgs($method, $args);
29
            }
30
        }
31
32 14
        resolve('heyman.chains')->forgetAbout(...$args);
0 ignored issues
show
Bug introduced by
The method forgetAbout() does not exist on Illuminate\Foundation\Application. ( Ignorable by Annotation )

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

32
        resolve('heyman.chains')->/** @scrutinizer ignore-call */ forgetAbout(...$args);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
33 14
    }
34
}
35