Closed
Description
Since PHP 8.0 passing null
to strlen
is deprecated.
This can for example happen in ReferenceBag#L357 where null is passed to ParserBase#L29 when git fails to execute show-ref
(happened when doing hasBranch
on an empty repo)
There are 12 instances of strlen
used. All but one of them in parsers and one in StringHelper#L36 as a fallback for mb_strlen
. Some of these usages can also always be expected to be a string.
There are two ways that come into mind to fix these problems:
1: Check the input if it is null
2: Add stricter types to input parameters and change logic to not pass null to functions that expect a string.
If there is a preferred method let me know and I can look into making a PR for this.
Metadata
Metadata
Assignees
Labels
No labels