Compare commits

..
5 Commits
Author SHA1 Message Date
Barry vd. Heuvel 8740a9a158 Fix CS 2019-09-08 11:56:38 +02:00
liquid207 d344cdc842 Fix phpcs (#803) 2019-09-08 11:55:17 +02:00
Mandy Schoep 5e411ef104 Do not added instances of a anonymous class to the phpstorm_meta file (#806) 2019-09-08 11:46:25 +02:00
Barry vd. Heuvel 499a2113b3 Check if method exists 2019-09-08 11:45:23 +02:00
Barry vd. Heuvel f8a8cb18e0 Always require doctrine 2019-09-08 11:36:40 +02:00
4 changed files with 7 additions and 9 deletions
+3 -6
View File
@@ -15,7 +15,8 @@
"illuminate/console": "^5.5|^6",
"illuminate/filesystem": "^5.5|^6",
"barryvdh/reflection-docblock": "^2.0.6",
"composer/composer": "^1.6"
"composer/composer": "^1.6",
"doctrine/dbal": "~2.3"
},
"require-dev": {
"illuminate/config": "^5.5|^6",
@@ -23,11 +24,7 @@
"phpro/grumphp": "^0.14",
"phpunit/phpunit" : "4.*",
"scrutinizer/ocular": "~1.1",
"squizlabs/php_codesniffer": "^3",
"doctrine/dbal": "~2.3"
},
"suggest": {
"doctrine/dbal": "Load information from the database about models for phpdocs (~2.3)"
"squizlabs/php_codesniffer": "^3"
},
"autoload": {
"psr-4": {
+1 -1
View File
@@ -316,7 +316,7 @@ class Alias
{
foreach ($this->magicMethods as $magic => $real) {
list($className, $name) = explode('::', $real);
if (!class_exists($className) && !interface_exists($className)) {
if ((!class_exists($className) && !interface_exists($className)) || !method_exists($className, $name)) {
continue;
}
$method = new \ReflectionMethod($className, $name);
+2 -1
View File
@@ -88,7 +88,8 @@ class MetaCommand extends Command
try {
$concrete = $this->laravel->make($abstract);
if (is_object($concrete)) {
$reflectionClass = new \ReflectionClass($concrete);
if (is_object($concrete) && !$reflectionClass->isAnonymous()) {
$bindings[$abstract] = get_class($concrete);
}
} catch (\Throwable $e) {
+1 -1
View File
@@ -456,7 +456,7 @@ class ModelsCommand extends Command
//Use reflection to inspect the code, based on Illuminate/Support/SerializableClosure.php
$reflection = new \ReflectionMethod($model, $method);
// php 7.x type or fallback to docblock
$type = (string)($reflection->getReturnType() ?: $this->getReturnTypeFromDocBlock($reflection));
$type = (string) ($reflection->getReturnType() ?: $this->getReturnTypeFromDocBlock($reflection));
$file = new \SplFileObject($reflection->getFileName());
$file->seek($reflection->getStartLine() - 1);