From ef125ae6038997ddc189685fbda02a10d9aa5f76 Mon Sep 17 00:00:00 2001 From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com> Date: Tue, 10 Jun 2025 09:19:20 +0200 Subject: [PATCH] code_samples_usage.php: Fix nullables --- tools/code_samples/code_samples_usage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/code_samples/code_samples_usage.php b/tools/code_samples/code_samples_usage.php index 1fd34604b6..2d7716d4a0 100644 --- a/tools/code_samples/code_samples_usage.php +++ b/tools/code_samples/code_samples_usage.php @@ -18,7 +18,7 @@ } } -function displayBlocks(array $docFileBlocks, string $docFilePath = null, $lineOffset = 0): void +function displayBlocks(array $docFileBlocks, ?string $docFilePath = null, $lineOffset = 0): void { if (!$docFilePath) { $docFilePath = ''; @@ -53,7 +53,7 @@ function displayBlocks(array $docFileBlocks, string $docFilePath = null, $lineOf * If null, all files including a file are returned. * @return array List of file paths from docs/ directory. */ -function getIncludingFileList(string $codeSampleFilePath = null): array +function getIncludingFileList(?string $codeSampleFilePath = null): array { $pattern = null === $codeSampleFilePath ? '= include_file' : $codeSampleFilePath; $pattern = escapeshellarg($pattern); @@ -71,7 +71,7 @@ function getIncludingFileList(string $codeSampleFilePath = null): array * @return array> List of blocks. A block is an array of consecutive lines where the key is the one-based line number. * @todo Create a Block class */ -function getInclusionBlocks(string $docFilePath, string $codeSampleFilePath = null): array +function getInclusionBlocks(string $docFilePath, ?string $codeSampleFilePath = null): array { $pattern = null === $codeSampleFilePath ? '= include_file' : $codeSampleFilePath;