Skip to content

[9.x] Rename $conn to meaningful name $connection #36713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Illuminate/Auth/DatabaseUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DatabaseUserProvider implements UserProvider
*
* @var \Illuminate\Database\ConnectionInterface
*/
protected $conn;
protected $connection;

/**
* The hasher implementation.
Expand All @@ -40,9 +40,9 @@ class DatabaseUserProvider implements UserProvider
* @param string $table
* @return void
*/
public function __construct(ConnectionInterface $conn, HasherContract $hasher, $table)
public function __construct(ConnectionInterface $connection, HasherContract $hasher, $table)
{
$this->conn = $conn;
$this->connection = $connection;
$this->table = $table;
$this->hasher = $hasher;
}
Expand All @@ -55,7 +55,7 @@ public function __construct(ConnectionInterface $conn, HasherContract $hasher, $
*/
public function retrieveById($identifier)
{
$user = $this->conn->table($this->table)->find($identifier);
$user = $this->connection->table($this->table)->find($identifier);

return $this->getGenericUser($user);
}
Expand All @@ -70,7 +70,7 @@ public function retrieveById($identifier)
public function retrieveByToken($identifier, $token)
{
$user = $this->getGenericUser(
$this->conn->table($this->table)->find($identifier)
$this->connection->table($this->table)->find($identifier)
);

return $user && $user->getRememberToken() && hash_equals($user->getRememberToken(), $token)
Expand All @@ -86,7 +86,7 @@ public function retrieveByToken($identifier, $token)
*/
public function updateRememberToken(UserContract $user, $token)
{
$this->conn->table($this->table)
$this->connection->table($this->table)
->where($user->getAuthIdentifierName(), $user->getAuthIdentifier())
->update([$user->getRememberTokenName() => $token]);
}
Expand All @@ -108,7 +108,7 @@ public function retrieveByCredentials(array $credentials)
// First we will add each credential element to the query as a where clause.
// Then we can execute the query and, if we found a user, return it in a
// generic "user" object that will be utilized by the Guard instances.
$query = $this->conn->table($this->table);
$query = $this->connection->table($this->table);

foreach ($credentials as $key => $value) {
if (Str::contains($key, 'password')) {
Expand Down