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

Passed
Pull Request — main (#5687)
by Pedro
14:53
created

PanelHooks   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 13
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 0 3 1
A run() 0 5 3
A has() 0 3 1
1
<?php
2
3
namespace Backpack\CRUD\app\Library\CrudPanel\Hooks;
4
5
final class PanelHooks
6
{
7
    const BEFORE_SETUP_ROUTES = 'beforeSetupRoutes';
8
    const AFTER_SETUP_ROUTES = 'afterSetupRoutes';
9
    const BEFORE_SETUP_DEFAULTS = 'beforeSetupDefaults';
10
    const AFTER_SETUP_DEFAULTS = 'afterSetupDefaults';
11
    const BEFORE_CONTROLLER_SETUP = 'beforeControllerSetup';
12
    const AFTER_CONTROLLER_SETUP = 'afterControllerSetup';
13
14
    public array $hooks = [];
15
16
    public function register(string $hook, callable $callback): void
17
    {
18
        $this->hooks[$hook][] = $callback;
19
    }
20
21
    public function run(string $hook, array $parameters): void
22
    {
23
        if (isset($this->hooks[$hook])) {
24
            foreach ($this->hooks[$hook] as $callback) {
25
                $callback(...$parameters);
26
            }
27
        }
28
    }
29
30
    public function has(string $hook): bool
31
    {
32
        return isset($this->hooks[$hook]);
33
    }
34
}
35