Closed nagaho closed 4 years ago
I used php-7.4.2 and https://github.com/lvht/phpcd.vim/commit/0f56ec88fd419cbd772e9052a60e8c376a766442
It works fine.
You might need test the latest phpcd.
It works with the following modifications.
PHPCD.php
@@ -844,7 +844,7 @@ class PHPCD implements RpcHandler
if ($hintedClass) {
$paramString .= $hintedClass->getName() . ' ';
} elseif (method_exists($param, 'hasType') && $param->hasType()) {
- $paramString .= $param->getType() . ' ';
+ $paramString .= $param->getType()->getName() . ' ';
}
$paramString .= '$' . $param->getName();
if (!$param->isDefaultValueAvailable()) {
@@ -879,7 +879,7 @@ class PHPCD implements RpcHandler
}
$returnType = '';
if (method_exists($method, 'getReturnType') && $method->hasReturnType()) {
- $returnType = " : " . (string)$method->getReturnType();
+ $returnType = " : " . (string)$method->getReturnType()->getName();
}
$docblock = $this->clearDoc($method->getDocComment());
return sprintf(
thank you
PHPCD.DEBUG: ErrorException: Function ReflectionType::__toString() is deprecated in PHPCD.php:847