Open alvarose opened 4 years ago
I think this line is making this error:
https://github.com/Peekmo/atom-autocomplete-php/blob/master/php/services/Tools.php
$result['return']['type'] = method_exists($function, 'getReturnType') && $function->hasReturnType() // PHP7
? $function->getReturnType()->__toString()
: $result['return']['type']
;
I think it should be replaced with:
https://github.com/event-engine/php-data/pull/2/commits/e8daa9e1f6673238d18b626526acde96fca097fb
$returnType = $method->getReturnType();
$type = $returnType->getName();
Final result should be:
$result['return']['type'] = method_exists($function, 'getReturnType') && $function->hasReturnType() // PHP7
? $function->getReturnType()->getName()
: $result['return']['type']
;
I haven't tested if it but I made some first changes for testing purposes:
https://github.com/orukaz/atom-autocomplete-php/blob/master/php/services/Tools.php
Hi friend! Did you test it? How can I check if that works? Good job!
I've tried it and it works! Just put this line as you said and voila !:
? $function->getReturnType()->getName()
Whenever I open a php file I get this error: