Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Test Failed
Push — operation-hooks ( b353ee )
by Pedro
14:39
created

BackpackHooks::has()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\app\Library\CrudPanel\Hooks;
4
5
final class BackpackHooks
6
{
7
    public array $hooks = [];
8
9
    public static function register(string $hook, string|array $operations, callable $callback): void
10
    {
11
        $operations = is_array($operations) ? $operations : [$operations];
0 ignored issues
show
introduced by
The condition is_array($operations) is always true.
Loading history...
12
13
        foreach ($operations as $operation) {
14
            self::$hooks[$operation][$hook] = $callback;
15
        }
16
    }
17
18
    public static function run(string $hook, string $operation, array $parameters): void
19
    {
20
        if (isset(self::$operationHooks[$operation][$hook])) {
0 ignored issues
show
Bug Best Practice introduced by
The property operationHooks does not exist on Backpack\CRUD\app\Librar...nel\Hooks\BackpackHooks. Did you maybe forget to declare it?
Loading history...
21
            self::$hooks[$operation][$hook](...$parameters);
22
        }
23
    }
24
25
    public static function has(string $hook, string $operation): bool
26
    {
27
        return isset(self::$hooks[$operation][$hook]);
28
    }
29
}
30