11<?php
22
3+ declare (strict_types=1 );
4+
35namespace PHPFastCGI \FastCGIDaemon ;
46
57use PHPFastCGI \FastCGIDaemon \Exception \ShutdownException ;
@@ -38,10 +40,10 @@ trait DaemonTrait
3840
3941 /**
4042 * Flags the daemon for shutting down.
41- *
43+ *
4244 * @param string $message Optional shutdown message
4345 */
44- public function flagShutdown ($ message = null )
46+ public function flagShutdown (string $ message = null ): void
4547 {
4648 $ this ->isShutdown = true ;
4749 $ this ->shutdownMessage = (null === $ message ? 'Daemon flagged for shutdown ' : $ message );
@@ -51,9 +53,9 @@ public function flagShutdown($message = null)
5153 * Loads to configuration from the daemon options and installs signal
5254 * handlers.
5355 *
54- * @param DaemonOptions $daemonOptions
56+ * @param DaemonOptionsInterface $daemonOptions
5557 */
56- private function setupDaemon (DaemonOptions $ daemonOptions )
58+ private function setupDaemon (DaemonOptionsInterface $ daemonOptions ): void
5759 {
5860 $ this ->requestCount = 0 ;
5961 $ this ->requestLimit = $ daemonOptions ->getOption (DaemonOptions::REQUEST_LIMIT );
@@ -74,7 +76,7 @@ private function setupDaemon(DaemonOptions $daemonOptions)
7476 *
7577 * @param int[] $statusCodes The status codes of sent responses
7678 */
77- private function considerStatusCodes ($ statusCodes )
79+ private function considerStatusCodes (array $ statusCodes ): void
7880 {
7981 $ this ->requestCount += count ($ statusCodes );
8082
@@ -94,7 +96,7 @@ private function considerStatusCodes($statusCodes)
9496 *
9597 * @throws ShutdownException On receiving a SIGINT or SIGALRM
9698 */
97- private function installSignalHandlers ()
99+ private function installSignalHandlers (): void
98100 {
99101 declare (ticks = 1 );
100102
@@ -114,7 +116,7 @@ private function installSignalHandlers()
114116 *
115117 * @throws ShutdownException When limits in the daemon options are exceeded
116118 */
117- private function checkDaemonLimits ()
119+ private function checkDaemonLimits (): void
118120 {
119121 if ($ this ->isShutdown ) {
120122 throw new ShutdownException ($ this ->shutdownMessage );
0 commit comments