Prevent ErrorException if $parts is empty
If `$level` reaches 0, `array_slice($parts, 0, $level)` returns an empty array. This will issue a "undefined index notice" in the next recursion on `$part = $parts[$level]`. This notice gets transformed to an ErrorException which will cancel further analysis.pull/750/head
parent
9dc1656592
commit
5a4605f2ea
|
@ -423,6 +423,10 @@ class Index implements ReadableIndex, \Serializable
|
||||||
*/
|
*/
|
||||||
private function removeIndexedDefinition(int $level, array $parts, array &$storage, array &$rootStorage)
|
private function removeIndexedDefinition(int $level, array $parts, array &$storage, array &$rootStorage)
|
||||||
{
|
{
|
||||||
|
if (empty($parts)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$part = $parts[$level];
|
$part = $parts[$level];
|
||||||
|
|
||||||
if ($level + 1 === count($parts)) {
|
if ($level + 1 === count($parts)) {
|
||||||
|
|
Loading…
Reference in New Issue