Skip to content

Commit 68d34a7

Browse files
authored
code_samples_usage.php: Fix nullables (#2777)
1 parent cae1c4b commit 68d34a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/code_samples/code_samples_usage.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
}
2020

21-
function displayBlocks(array $docFileBlocks, string $docFilePath = null, $lineOffset = 0): void
21+
function displayBlocks(array $docFileBlocks, ?string $docFilePath = null, $lineOffset = 0): void
2222
{
2323
if (!$docFilePath) {
2424
$docFilePath = '';
@@ -53,7 +53,7 @@ function displayBlocks(array $docFileBlocks, string $docFilePath = null, $lineOf
5353
* If null, all files including a file are returned.
5454
* @return array<int, string> List of file paths from docs/ directory.
5555
*/
56-
function getIncludingFileList(string $codeSampleFilePath = null): array
56+
function getIncludingFileList(?string $codeSampleFilePath = null): array
5757
{
5858
$pattern = null === $codeSampleFilePath ? '= include_file' : $codeSampleFilePath;
5959
$pattern = escapeshellarg($pattern);
@@ -71,7 +71,7 @@ function getIncludingFileList(string $codeSampleFilePath = null): array
7171
* @return array<int, array<int, string>> List of blocks. A block is an array of consecutive lines where the key is the one-based line number.
7272
* @todo Create a Block class
7373
*/
74-
function getInclusionBlocks(string $docFilePath, string $codeSampleFilePath = null): array
74+
function getInclusionBlocks(string $docFilePath, ?string $codeSampleFilePath = null): array
7575
{
7676
$pattern = null === $codeSampleFilePath ? '= include_file' : $codeSampleFilePath;
7777

0 commit comments

Comments
 (0)