Skip to content

Commit 83516dc

Browse files
committed
[BUGFIX] Mitigate "Using null as an array offset is deprecated"
Using `DocBlockFactory->create()` with a phpdocblock hanging a `@throws` tag followed by a exception class name emits following PHP 8.5.0 deprecation: ``` Using null as an array offset is deprecated, use an empty string instead ``` in `StandardTagFactory->getArgumentsForParametersFromWiring()`. This change uses the null-coalsce operator to fallback to an empty string for the value which should be used as an array key instead of using `null` to mitigate the deprecation notice with PHP8.5.0 and matches the behaviour in earlier PHP versions without the deprecation message.
1 parent 90a04bc commit 83516dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/unit/DocBlock/StandardTagFactoryTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,11 @@ public function validTagProvider(): array
525525
'tag',
526526
'@tag (is valid)',
527527
],
528+
'full-qualified-class-name following a tag name is valid' => [
529+
'@tag \InvalidArgumentException',
530+
'tag',
531+
'@tag \InvalidArgumentException',
532+
],
528533
];
529534
}
530535

0 commit comments

Comments
 (0)