More PHP 8.1 deprecations
jurgenhaas opened this issue · comments
The first one is
Deprecation Notice: array_splice(): Passing null to parameter #2 ($offset) of type int is deprecated in /drupal/vendor/cypresslab/gitelephant/src/GitElephant/Objects/Remote.php:269
What gets passed to that function is this array:
Array
(
[remoteBranches] =>
[localBranches] => 6
[localRefs] =>
)
So, instead of remote branches and local refs being zero, they seem to be NULL.
Not sure how that needed to be fixed.
Looks like this might be the correct approach, but I'm not certain:
- $configuredRefs[$type] = array_splice($remoteDetails, $lineno);
+ $configuredRefs[$type] = $lineno === NULL ? [] : array_splice($remoteDetails, $lineno);