php-language-server
php-language-server copied to clipboard
Prevent "undefined index" notice if $parts array is empty in Index\Index#removeIndexedDefinition
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