Skip to content

Commit

Permalink
Remove unnecessary version checks due to unsupported old Laravel/Lume…
Browse files Browse the repository at this point in the history
…n 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 )
  • Loading branch information
mfn authored Jun 28, 2020
1 parent f3d841c commit 6cb0201
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6cb0201

Please sign in to comment.