]> BookStack Code Mirror - bookstack/blobdiff - app/Auth/Access/ExternalBaseUserProvider.php
Fixed tests from streaming changes
[bookstack] / app / Auth / Access / ExternalBaseUserProvider.php
index 69295ee4e900188cc2c7c3097b0a3c3379195b57..122425c1157f33618049b550ca51169a9c9eef98 100644 (file)
@@ -4,10 +4,10 @@ namespace BookStack\Auth\Access;
 
 use Illuminate\Contracts\Auth\Authenticatable;
 use Illuminate\Contracts\Auth\UserProvider;
+use Illuminate\Database\Eloquent\Model;
 
 class ExternalBaseUserProvider implements UserProvider
 {
-
     /**
      * The user model.
      *
@@ -17,7 +17,6 @@ class ExternalBaseUserProvider implements UserProvider
 
     /**
      * LdapUserProvider constructor.
-     * @param             $model
      */
     public function __construct(string $model)
     {
@@ -27,19 +26,21 @@ class ExternalBaseUserProvider implements UserProvider
     /**
      * Create a new instance of the model.
      *
-     * @return \Illuminate\Database\Eloquent\Model
+     * @return Model
      */
     public function createModel()
     {
         $class = '\\' . ltrim($this->model, '\\');
-        return new $class;
+
+        return new $class();
     }
 
     /**
      * Retrieve a user by their unique identifier.
      *
-     * @param  mixed $identifier
-     * @return \Illuminate\Contracts\Auth\Authenticatable|null
+     * @param mixed $identifier
+     *
+     * @return Authenticatable|null
      */
     public function retrieveById($identifier)
     {
@@ -49,21 +50,22 @@ class ExternalBaseUserProvider implements UserProvider
     /**
      * Retrieve a user by their unique identifier and "remember me" token.
      *
-     * @param  mixed  $identifier
-     * @param  string $token
-     * @return \Illuminate\Contracts\Auth\Authenticatable|null
+     * @param mixed  $identifier
+     * @param string $token
+     *
+     * @return Authenticatable|null
      */
     public function retrieveByToken($identifier, $token)
     {
         return null;
     }
 
-
     /**
      * Update the "remember me" token for the given user in storage.
      *
-     * @param  \Illuminate\Contracts\Auth\Authenticatable $user
-     * @param  string                                     $token
+     * @param Authenticatable $user
+     * @param string          $token
+     *
      * @return void
      */
     public function updateRememberToken(Authenticatable $user, $token)
@@ -74,13 +76,15 @@ class ExternalBaseUserProvider implements UserProvider
     /**
      * Retrieve a user by the given credentials.
      *
-     * @param  array $credentials
-     * @return \Illuminate\Contracts\Auth\Authenticatable|null
+     * @param array $credentials
+     *
+     * @return 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 +93,9 @@ class ExternalBaseUserProvider implements UserProvider
     /**
      * Validate a user against the given credentials.
      *
-     * @param  \Illuminate\Contracts\Auth\Authenticatable $user
-     * @param  array                                      $credentials
+     * @param Authenticatable $user
+     * @param array           $credentials
+     *
      * @return bool
      */
     public function validateCredentials(Authenticatable $user, array $credentials)