From 6cb0201476f0842b6e1d23765bf91e974244aed8 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Sun, 28 Jun 2020 22:14:44 +0200 Subject: [PATCH] Remove unnecessary version checks due to unsupported old Laravel/Lumen versions (#983) - support for < L5.5 was dropped, so no need to check if it's >= Laravel 5.2 - for the same reason, the Lumen 5.0/5.1 check isn't necessary because only supporting Laravel 5.5 means we only support the Laravel 5.5 _components_ which means the minimum supported Lumen version is also 5.5 (per https://lumen.laravel.com/docs/master/releases#5.5.0 ) --- src/Generator.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Generator.php b/src/Generator.php index 7f8b138fb..6e1c487e7 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -128,16 +128,7 @@ protected function detectDrivers() class_exists('Auth') && is_a('Auth', '\Illuminate\Support\Facades\Auth', true) && app()->bound('auth') ) { - if (class_exists('\Illuminate\Foundation\Application')) { - $authMethod = version_compare(Application::VERSION, '5.2', '>=') ? 'guard' : 'driver'; - } else { - $refClass = new ReflectionClass('\Laravel\Lumen\Application'); - $versionStr = $refClass->newInstanceWithoutConstructor()->version(); - $authMethod = strpos($versionStr, 'Lumen (5.0') === 0 ? - 'driver' : - (strpos($versionStr, 'Lumen (5.1') === 0 ? 'driver' : 'guard'); - } - $class = get_class(\Auth::$authMethod()); + $class = get_class(\Auth::guard()); $this->extra['Auth'] = array($class); $this->interfaces['\Illuminate\Auth\UserProviderInterface'] = $class; }