Skip to content

Commit 0168e72

Browse files
authored
Fix generate error when macroable class has a "fake" method (#1066)
1 parent 1044f46 commit 0168e72

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file.
1616
### Fixed
1717
- Compatibility with Lumen [\#1043 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1043)
1818
- Allow model_locations to have glob patterns [\#1059 / saackearl](https://github.com/barryvdh/laravel-ide-helper/pull/1059)
19+
- 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)
1920

2021
2020-09-07, 2.8.1
2122
-----------------

src/Alias.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use Barryvdh\Reflection\DocBlock\Tag\MethodTag;
1818
use Closure;
1919
use Illuminate\Config\Repository as ConfigRepository;
20+
use Illuminate\Support\Facades\Facade;
2021
use ReflectionClass;
2122

2223
class Alias
@@ -202,6 +203,10 @@ protected function detectFake()
202203
{
203204
$facade = $this->facade;
204205

206+
if (!is_subclass_of($facade, Facade::class)) {
207+
return;
208+
}
209+
205210
if (!method_exists($facade, 'fake')) {
206211
return;
207212
}

0 commit comments

Comments
 (0)