__toString function has been DEPRECATED (#801)

* __toString function has been DEPRECATED

__toString function has been DEPRECATED as of PHP 7.1.0

* remove code

remove code
This commit is contained in:
cxlblm
2019-09-17 07:08:26 +02:00
committed by Barry vd. Heuvel
parent 428d32cebd
commit 25b61c56fe
+6 -1
View File
@@ -455,8 +455,13 @@ class ModelsCommand extends Command
) {
//Use reflection to inspect the code, based on Illuminate/Support/SerializableClosure.php
$reflection = new \ReflectionMethod($model, $method);
if ($returnType = $reflection->getReturnType()) {
$type = $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string)$returnType;
} else {
// php 7.x type or fallback to docblock
$type = (string) ($reflection->getReturnType() ?: $this->getReturnTypeFromDocBlock($reflection));
$type = (string)$this->getReturnTypeFromDocBlock($reflection);
}
$file = new \SplFileObject($reflection->getFileName());
$file->seek($reflection->getStartLine() - 1);