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 ( da886e...6a167e )
by Pedro
11:37
created

LifecycleHooks::trigger()   A

Complexity

Conditions 5
Paths 8

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 5
eloc 5
nc 8
nop 2
dl 0
loc 7
rs 9.6111
c 1
b 0
f 0
1
<?php
2
3
namespace Backpack\CRUD\app\Library\CrudPanel\Hooks;
4
5
final class LifecycleHooks
6
{
7
    public array $hooks = [];
8
9
    public function hookInto(string|array $hooks, callable $callback): void
10
    {
11
        $hooks = is_array($hooks) ? $hooks : [$hooks];
0 ignored issues
show
introduced by
The condition is_array($hooks) is always true.
Loading history...
12
        foreach ($hooks as $hook) {
13
            $this->hooks[$hook][] = $callback;
14
        }
15
    }
16
17
    public function trigger(string|array $hooks, array $parameters): void
18
    {
19
        $hooks = is_array($hooks) ? $hooks : [$hooks];
0 ignored issues
show
introduced by
The condition is_array($hooks) is always true.
Loading history...
20
        foreach ($hooks as $hook) {
21
            if (isset($this->hooks[$hook])) {
22
                foreach ($this->hooks[$hook] as $callback) {
23
                    $callback(...$parameters);
24
                }
25
            }
26
        }
27
    }
28
29
    public function has(string $hook): bool
30
    {
31
        return isset($this->hooks[$hook]);
32
    }
33
}
34