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   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 23
rs 10
c 1
b 0
f 0
wmc 6

3 Methods

Rating   Name   Duplication   Size   Complexity  
A has() 0 3 1
A run() 0 4 2
A register() 0 6 3
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