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 )
This commit is contained in:
Markus Podar
2020-06-28 22:14:44 +02:00
committed by GitHub
parent f3d841c0a3
commit 6cb0201476
+1 -10
View File
@@ -128,16 +128,7 @@ class Generator
class_exists('Auth') && is_a('Auth', '\Illuminate\Support\Facades\Auth', true) class_exists('Auth') && is_a('Auth', '\Illuminate\Support\Facades\Auth', true)
&& app()->bound('auth') && app()->bound('auth')
) { ) {
if (class_exists('\Illuminate\Foundation\Application')) { $class = get_class(\Auth::guard());
$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());
$this->extra['Auth'] = array($class); $this->extra['Auth'] = array($class);
$this->interfaces['\Illuminate\Auth\UserProviderInterface'] = $class; $this->interfaces['\Illuminate\Auth\UserProviderInterface'] = $class;
} }