Barryvdh\LaravelIdeHelper\Generator::detectDrivers PHP Метод

detectDrivers() защищенный Метод

protected detectDrivers ( )
    protected function detectDrivers()
    {
        $defaultUserModel = config('auth.providers.users.model', config('auth.model', 'App\\User'));
        $this->interfaces['\\Illuminate\\Contracts\\Auth\\Authenticatable'] = $defaultUserModel;
        try {
            if (class_exists('Auth') && is_a('Auth', '\\Illuminate\\Support\\Facades\\Auth', true)) {
                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());
                $this->extra['Auth'] = array($class);
                $this->interfaces['\\Illuminate\\Auth\\UserProviderInterface'] = $class;
            }
        } catch (\Exception $e) {
        }
        try {
            if (class_exists('DB') && is_a('DB', '\\Illuminate\\Support\\Facades\\DB', true)) {
                $class = get_class(\DB::connection());
                $this->extra['DB'] = array($class);
                $this->interfaces['\\Illuminate\\Database\\ConnectionInterface'] = $class;
            }
        } catch (\Exception $e) {
        }
        try {
            if (class_exists('Cache') && is_a('Cache', '\\Illuminate\\Support\\Facades\\Cache', true)) {
                $driver = get_class(\Cache::driver());
                $store = get_class(\Cache::getStore());
                $this->extra['Cache'] = array($driver, $store);
                $this->interfaces['\\Illuminate\\Cache\\StoreInterface'] = $store;
            }
        } catch (\Exception $e) {
        }
        try {
            if (class_exists('Queue') && is_a('Queue', '\\Illuminate\\Support\\Facades\\Queue', true)) {
                $class = get_class(\Queue::connection());
                $this->extra['Queue'] = array($class);
                $this->interfaces['\\Illuminate\\Queue\\QueueInterface'] = $class;
            }
        } catch (\Exception $e) {
        }
        try {
            if (class_exists('SSH') && is_a('SSH', '\\Illuminate\\Support\\Facades\\SSH', true)) {
                $class = get_class(\SSH::connection());
                $this->extra['SSH'] = array($class);
                $this->interfaces['\\Illuminate\\Remote\\ConnectionInterface'] = $class;
            }
        } catch (\Exception $e) {
        }
        try {
            if (class_exists('Storage') && is_a('Storage', '\\Illuminate\\Support\\Facades\\Storage', true)) {
                $class = get_class(\Storage::disk());
                $this->extra['Storage'] = array($class);
                $this->interfaces['\\Illuminate\\Contracts\\Filesystem\\Filesystem'] = $class;
            }
        } catch (\Exception $e) {
        }
    }