1
1
<?php
2
2
3
+ declare (strict_types=1 );
4
+
3
5
namespace PHPFastCGI \FastCGIDaemon ;
4
6
5
7
use PHPFastCGI \FastCGIDaemon \Exception \ShutdownException ;
@@ -38,10 +40,10 @@ trait DaemonTrait
38
40
39
41
/**
40
42
* Flags the daemon for shutting down.
41
- *
43
+ *
42
44
* @param string $message Optional shutdown message
43
45
*/
44
- public function flagShutdown ($ message = null )
46
+ public function flagShutdown (string $ message = null ): void
45
47
{
46
48
$ this ->isShutdown = true ;
47
49
$ this ->shutdownMessage = (null === $ message ? 'Daemon flagged for shutdown ' : $ message );
@@ -51,9 +53,9 @@ public function flagShutdown($message = null)
51
53
* Loads to configuration from the daemon options and installs signal
52
54
* handlers.
53
55
*
54
- * @param DaemonOptions $daemonOptions
56
+ * @param DaemonOptionsInterface $daemonOptions
55
57
*/
56
- private function setupDaemon (DaemonOptions $ daemonOptions )
58
+ private function setupDaemon (DaemonOptionsInterface $ daemonOptions ): void
57
59
{
58
60
$ this ->requestCount = 0 ;
59
61
$ this ->requestLimit = $ daemonOptions ->getOption (DaemonOptions::REQUEST_LIMIT );
@@ -74,7 +76,7 @@ private function setupDaemon(DaemonOptions $daemonOptions)
74
76
*
75
77
* @param int[] $statusCodes The status codes of sent responses
76
78
*/
77
- private function considerStatusCodes ($ statusCodes )
79
+ private function considerStatusCodes (array $ statusCodes ): void
78
80
{
79
81
$ this ->requestCount += count ($ statusCodes );
80
82
@@ -94,7 +96,7 @@ private function considerStatusCodes($statusCodes)
94
96
*
95
97
* @throws ShutdownException On receiving a SIGINT or SIGALRM
96
98
*/
97
- private function installSignalHandlers ()
99
+ private function installSignalHandlers (): void
98
100
{
99
101
declare (ticks = 1 );
100
102
@@ -114,7 +116,7 @@ private function installSignalHandlers()
114
116
*
115
117
* @throws ShutdownException When limits in the daemon options are exceeded
116
118
*/
117
- private function checkDaemonLimits ()
119
+ private function checkDaemonLimits (): void
118
120
{
119
121
if ($ this ->isShutdown ) {
120
122
throw new ShutdownException ($ this ->shutdownMessage );
0 commit comments