]> BookStack Code Mirror - bookstack/blobdiff - app/Auth/Access/ExternalBaseUserProvider.php
Reverted shift change to old migration
[bookstack] / app / Auth / Access / ExternalBaseUserProvider.php
index 69295ee4e900188cc2c7c3097b0a3c3379195b57..fde610c3e18746f33b616c4b309a91327eb77d91 100644 (file)
@@ -7,7 +7,6 @@ use Illuminate\Contracts\Auth\UserProvider;
 
 class ExternalBaseUserProvider implements UserProvider
 {
-
     /**
      * The user model.
      *
@@ -17,7 +16,8 @@ class ExternalBaseUserProvider implements UserProvider
 
     /**
      * LdapUserProvider constructor.
-     * @param             $model
+     *
+     * @param $model
      */
     public function __construct(string $model)
     {
@@ -32,13 +32,15 @@ class ExternalBaseUserProvider implements UserProvider
     public function createModel()
     {
         $class = '\\' . ltrim($this->model, '\\');
-        return new $class;
+
+        return new $class();
     }
 
     /**
      * Retrieve a user by their unique identifier.
      *
-     * @param  mixed $identifier
+     * @param mixed $identifier
+     *
      * @return \Illuminate\Contracts\Auth\Authenticatable|null
      */
     public function retrieveById($identifier)
@@ -49,8 +51,9 @@ class ExternalBaseUserProvider implements UserProvider
     /**
      * Retrieve a user by their unique identifier and "remember me" token.
      *
-     * @param  mixed  $identifier
-     * @param  string $token
+     * @param mixed  $identifier
+     * @param string $token
+     *
      * @return \Illuminate\Contracts\Auth\Authenticatable|null
      */
     public function retrieveByToken($identifier, $token)
@@ -58,12 +61,12 @@ class ExternalBaseUserProvider implements UserProvider
         return null;
     }
 
-
     /**
      * Update the "remember me" token for the given user in storage.
      *
-     * @param  \Illuminate\Contracts\Auth\Authenticatable $user
-     * @param  string                                     $token
+     * @param \Illuminate\Contracts\Auth\Authenticatable $user
+     * @param string                                     $token
+     *
      * @return void
      */
     public function updateRememberToken(Authenticatable $user, $token)
@@ -74,13 +77,15 @@ class ExternalBaseUserProvider implements UserProvider
     /**
      * Retrieve a user by the given credentials.
      *
-     * @param  array $credentials
+     * @param array $credentials
+     *
      * @return \Illuminate\Contracts\Auth\Authenticatable|null
      */
     public function retrieveByCredentials(array $credentials)
     {
         // Search current user base by looking up a uid
         $model = $this->createModel();
+
         return $model->newQuery()
             ->where('external_auth_id', $credentials['external_auth_id'])
             ->first();
@@ -89,8 +94,9 @@ class ExternalBaseUserProvider implements UserProvider
     /**
      * Validate a user against the given credentials.
      *
-     * @param  \Illuminate\Contracts\Auth\Authenticatable $user
-     * @param  array                                      $credentials
+     * @param \Illuminate\Contracts\Auth\Authenticatable $user
+     * @param array                                      $credentials
+     *
      * @return bool
      */
     public function validateCredentials(Authenticatable $user, array $credentials)