autocomplete-php
autocomplete-php copied to clipboard
userFunc.test === null
Found a weird bug.
When two classes are defined in the same file and the second one's constructor has no parameters the @userSuggestions.user_functions[1].text === null which causes an error at povider.coffee#L167
<?php
class test1 {
public function __construct() {
}
}
class test2 {
public function __construct() {
}
}
@userSuggestions.user_functions is
[
{
"text": "__construct",
"type": "function",
"snippet": "__construct()${99}"
},
{
"text": null,
"type": "function",
"snippet": "()${99}"
}
]
I fixed it by changing userFunc.text.toLowerCase().indexOf(lowerCasePrefix) to userFunc.text?.toLowerCase().indexOf(lowerCasePrefix) but there is probably some underlying bug that should be fixed.
also getting Undefined offset: 0 in php error logs from get_user_all.php#L83
Looks like it is because technically there are 2 functions with the same name which should usually be an error but in this case is valid PHP