diff --git a/resources/views/helper.php b/resources/views/helper.php index 4a925bc..90b7413 100644 --- a/resources/views/helper.php +++ b/resources/views/helper.php @@ -23,15 +23,12 @@ */ $aliases) : ?> - -namespace { +namespace { - getDocComment(' ')) ?> + getDocComment(' ')) ?> getClassType() ?> getExtendsClass() ?> { getMethods() as $method) : ?> - getDocComment(' ')) ?> + getDocComment(' ')) ?> public static function getName() ?>(getParamsWithDefault() ?>) {getDeclaringClass() !== $method->getRoot()) : ?> //Method inherited from getDeclaringClass() ?> @@ -42,19 +39,19 @@ namespace { shouldReturn() ? 'return ' : '' ?>getRootMethodCall() ?>; } - + } - + } $aliases) : ?> -namespace { +namespace { getClassType() ?> getShortName() ?> extends getExtends() ?> {getExtendsNamespace() == '\Illuminate\Database\Eloquent') : ?> - getMethods() as $method) : ?> - getDocComment(' ')) ?> + getMethods() as $method) : ?> + getDocComment(' ')) ?> public static function getName() ?>(getParamsWithDefault() ?>) {getDeclaringClass() !== $method->getRoot()) : ?> //Method inherited from getDeclaringClass() ?> @@ -67,14 +64,14 @@ namespace { } } - + } namespace { - + } diff --git a/src/Generator.php b/src/Generator.php index abad534..9df9291 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -13,6 +13,7 @@ namespace Barryvdh\LaravelIdeHelper; use Illuminate\Foundation\AliasLoader; use Illuminate\Support\Collection; +use Illuminate\Support\Facades\Facade; use Illuminate\Support\Str; use Illuminate\Support\Traits\Macroable; use ReflectionClass; @@ -175,7 +176,9 @@ class Generator */ protected function getAliasesByExtendsNamespace() { - $aliases = $this->getValidAliases(); + $aliases = $this->getValidAliases()->filter(static function (Alias $alias) { + return is_subclass_of($alias->getExtends(), Facade::class); + }); $this->addMacroableClasses($aliases);