From 8b57fdf3d0783e0f4f685f2f9269dc1cd9c1b267 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sun, 11 Jan 2026 22:12:33 +0100 Subject: [PATCH] Add $runnerControl parameter to StdioTransport constructor (#205) * Add $runnerControl parameter to StdioTransport constructor * fix cs * fix phpstan baseline --------- Co-authored-by: Christopher Hertel --- phpstan-baseline.neon | 6 ------ src/Server/Transport/StdioTransport.php | 11 +++-------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 3f8e667..f5901b2 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -5,9 +5,3 @@ parameters: identifier: return.type count: 1 path: src/Schema/Result/ReadResourceResult.php - - - - message: '#^PHPDoc tag @param references unknown parameter\: \$runnerControl$#' - identifier: parameter.notFound - count: 1 - path: src/Server/Transport/StdioTransport.php diff --git a/src/Server/Transport/StdioTransport.php b/src/Server/Transport/StdioTransport.php index ff83bbe..4da7f2a 100644 --- a/src/Server/Transport/StdioTransport.php +++ b/src/Server/Transport/StdioTransport.php @@ -24,21 +24,16 @@ use Psr\Log\LoggerInterface; */ class StdioTransport extends BaseTransport { - private RunnerControlInterface $runnerControl; - /** - * @param resource $input - * @param resource $output - * @param ?RunnerControlInterface $runnerControl + * @param resource $input + * @param resource $output */ public function __construct( private $input = \STDIN, private $output = \STDOUT, ?LoggerInterface $logger = null, - /* ?RunnerControlInterface $runnerControl = null, */ + private readonly RunnerControlInterface $runnerControl = new RunnerControl(), ) { - // $runnerControl parameter was added in 0.2.1 and will be default in 0.3.0 - $this->runnerControl = \func_get_args()[3] ?? new RunnerControl(); parent::__construct($logger); }