forked from codeigniter4/queue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSignalTrait.phpstub
More file actions
132 lines (107 loc) · 2.73 KB
/
SignalTrait.phpstub
File metadata and controls
132 lines (107 loc) · 2.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
declare(strict_types=1);
namespace CodeIgniter\Queue\Compatibility;
use Closure;
/**
* Psalm stub for SignalTrait to handle conditional trait declaration
*
* This stub provides type information for Psalm when analyzing code that uses
* the SignalTrait compatibility layer. When CodeIgniter 4.7+ is installed,
* the actual trait from CodeIgniter\CLI\SignalTrait will be used instead.
*
* If this package starts requiring CI 4.7+, you can remove this stub and
* the ignoreFiles entry in psalm.xml for src/Compatibility/SignalTrait.php
*/
trait SignalTrait
{
private bool $running = true;
private bool $signalsBlocked = false;
/** @var list<int> */
private array $registeredSignals = [];
/** @var array<int, string> */
private array $signalMethodMap = [];
private static ?bool $isPcntlAvailable = null;
private static ?bool $isPosixAvailable = null;
protected function isPcntlAvailable(): bool
{
}
protected function isPosixAvailable(): bool
{
}
/**
* @param list<int> $signals
* @param array<int, string> $methodMap
*/
protected function registerSignals(array $signals = [], array $methodMap = []): void
{
}
protected function handleSignal(int $signal): void
{
}
protected function shouldTerminate(): bool
{
}
protected function isRunning(): bool
{
}
protected function requestTermination(): void
{
}
protected function resetState(): void
{
}
/**
* @template TReturn
* @param Closure():TReturn $operation
* @return TReturn
*/
protected function withSignalsBlocked(Closure $operation)
{
}
protected function blockSignals(): void
{
}
protected function unblockSignals(): void
{
}
protected function signalsBlocked(): bool
{
}
protected function mapSignal(int $signal, string $method): void
{
}
protected function getSignalName(int $signal): string
{
}
protected function unregisterSignals(): void
{
}
protected function hasSignals(): bool
{
}
/**
* @return list<int>
*/
protected function getSignals(): array
{
}
/**
* @return array{
* pid: int,
* running: bool,
* pcntl_available: bool,
* registered_signals: int,
* registered_signals_names: array<int, string>,
* signals_blocked: bool,
* explicit_mappings: int,
* memory_usage_mb: float,
* memory_peak_mb: float,
* session_id?: false|int,
* process_group?: false|int,
* has_controlling_terminal?: bool
* }
*/
protected function getProcessState(): array
{
}
}