php-language-server icon indicating copy to clipboard operation
php-language-server copied to clipboard

Prevent "undefined index" notice if $parts array is empty in Index\Index#removeIndexedDefinition

Open asccc opened this issue 6 years ago • 0 comments
trafficstars

If $level reaches 0 with only one more element in the $parts array, the next call to array_slice($parts, 0, $level) will return an empty array. This will trigger a "undefined index" notice in the next recursion on $part = $parts[$level]. This notice gets promoted to an ErrorException in the error-handler (if the local php.ini is configured to report notices) which will cancel further processing.

Fixes #695

asccc avatar Aug 01 '19 19:08 asccc