From eeb85df6894c8e410e3d22f3432175310a6410f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maurice=20Preu=C3=9F?= Date: Mon, 10 Nov 2025 01:45:09 +0100 Subject: [PATCH] Add additional parameters to createServer method --- src/Factory.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Factory.php b/src/Factory.php index 2984b3b..acea9db 100644 --- a/src/Factory.php +++ b/src/Factory.php @@ -16,12 +16,13 @@ class Factory /** * Creates Server node * @param int $port + * @param array $additionalParams * @return Server */ - public function createServer(int $port = 80) : Server + public function createServer(int $port = 80, array $additionalParams = []) : Server { - $listenIPv4 = new Directive('listen', [new Param($port)]); - $listenIPv6 = new Directive('listen', [new Param("[::]:{$port}")]); + $listenIPv4 = new Directive('listen', [new Param($port), ...$additionalParams]); + $listenIPv6 = new Directive('listen', [new Param("[::]:{$port}"), ...$additionalParams]); return new Server([$listenIPv4, $listenIPv6]); }