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 (#1450)
by Dan
07:00
created

CallbackEvent::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 6
dl 0
loc 8
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Smr\Irc;
4
5
/**
6
 * Manage callback events in the IRC driver.
7
 *
8
 * Some of the IRC listeners have to make queries to the IRC server before
9
 * continuing with processing, and this class stores the callback for those
10
 * queries so we can proceed once the server responds.
11
 */
12
class CallbackEvent {
13
14
	/** @var array<self> */
15
	private static array $EVENTS;
16
17
	/**
18
	 * @return array<self>
19
	 */
20
	public static function getAll(): array {
21
		return self::$EVENTS;
22
	}
23
24
	public static function add(self $eventToAdd): void {
25
		self::$EVENTS[] = $eventToAdd;
26
	}
27
28
	public static function remove(self $eventToRemove): void {
29
		foreach (self::$EVENTS as $key => $event) {
30
			if ($event === $eventToRemove) {
31
				unset(self::$EVENTS[$key]);
32
				break;
33
			}
34
		}
35
	}
36
37
	public function __construct(
38
		public readonly string $type,
39
		public readonly string $channel,
40
		public readonly string $nick,
41
		public readonly callable $callback,
42
		public readonly int $time,
43
		public readonly bool $validate
44
	) {}
45
46
}
47