As of PHP 8.1, passing null to not explicitly nullable scalar parameters for PHP native functions is deprecated.
In this case, $class within interpretCallable() may be null, which leads to the following deprecation notice as can be seen when running the tests on PHP 8.1:
Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in path/to/patchwork/src/Utils.php on line 123
By handling null separately and setting $class to an empty string, the previous behaviour is maintained.
As of PHP 8.1, passing
null
to not explicitly nullable scalar parameters for PHP native functions is deprecated.In this case,
$class
withininterpretCallable()
may be null, which leads to the following deprecation notice as can be seen when running the tests on PHP 8.1:By handling
null
separately and setting$class
to an empty string, the previous behaviour is maintained.Refs: