From 0168e7256bfec301864bd1c75b0cc1804c3b874e Mon Sep 17 00:00:00 2001 From: domkrm Date: Mon, 21 Sep 2020 16:26:32 +0200 Subject: [PATCH] Fix generate error when macroable class has a "fake" method (#1066) --- CHANGELOG.md | 1 + src/Alias.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14db60d..5d64d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Compatibility with Lumen [\#1043 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1043) - Allow model_locations to have glob patterns [\#1059 / saackearl](https://github.com/barryvdh/laravel-ide-helper/pull/1059) +- Error when generating helper for macroable classes which are not facades and contain a "fake" method [\#1066 / domkrm] (https://github.com/barryvdh/laravel-ide-helper/pull/1066) 2020-09-07, 2.8.1 ----------------- diff --git a/src/Alias.php b/src/Alias.php index 4ad4e87..7b834f5 100644 --- a/src/Alias.php +++ b/src/Alias.php @@ -17,6 +17,7 @@ use Barryvdh\Reflection\DocBlock\Serializer as DocBlockSerializer; use Barryvdh\Reflection\DocBlock\Tag\MethodTag; use Closure; use Illuminate\Config\Repository as ConfigRepository; +use Illuminate\Support\Facades\Facade; use ReflectionClass; class Alias @@ -202,6 +203,10 @@ class Alias { $facade = $this->facade; + if (!is_subclass_of($facade, Facade::class)) { + return; + } + if (!method_exists($facade, 'fake')) { return; }