Skip to content

Commit 0e3caec

Browse files
committed
chore: adjust code standards
1 parent 5693efe commit 0e3caec

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

src/MongolidUserProvider.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,18 @@ public function rehashPasswordIfRequired(
110110
#[SensitiveParameter] array $credentials,
111111
bool $force = false
112112
) {
113-
if (! $this->hasher->needsRehash($user->getAuthPassword()) && ! $force) {
113+
$needsRehash = $this->hasher->needsRehash(
114+
$user->getAuthPassword()
115+
);
116+
117+
if (!$needsRehash && !$force) {
114118
return;
115119
}
116120

117121
$user->forceFill([
118-
$user->getAuthPasswordName() => $this->hasher->make($credentials['password']),
122+
$user->getAuthPasswordName() => $this->hasher->make(
123+
$credentials['password']
124+
),
119125
])->save();
120126
}
121127

tests/MongolidFailedJobProviderTest.php

+14-14
Original file line numberDiff line numberDiff line change
@@ -149,20 +149,6 @@ public function testShouldReturnIds(array $expected, ?string $queue): void
149149
$this->assertEquals($expected, $result);
150150
}
151151

152-
public static function getIdsScenarios(): array
153-
{
154-
return [
155-
'no queue' => [
156-
'expected' => ['12345', '67890'],
157-
'queue' => null,
158-
],
159-
'with queue' => [
160-
'expected' => ['67890'],
161-
'queue' => 'queue2',
162-
],
163-
];
164-
}
165-
166152
public function testFindShouldReturnJob(): void
167153
{
168154
// Set
@@ -232,4 +218,18 @@ public function testFlushShouldDropWholeCollection(): void
232218
// Actions
233219
$provider->flush();
234220
}
221+
222+
public static function getIdsScenarios(): array
223+
{
224+
return [
225+
'no queue' => [
226+
'expected' => ['12345', '67890'],
227+
'queue' => null,
228+
],
229+
'with queue' => [
230+
'expected' => ['67890'],
231+
'queue' => 'queue2',
232+
],
233+
];
234+
}
235235
}

tests/MongolidUserProviderTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class MongolidUserProviderTest extends TestCase
1111
{
1212
private Hasher $hasher;
1313

14-
protected function setUp(): void
14+
public function setUp(): void
1515
{
1616
parent::setUp();
1717

@@ -200,7 +200,6 @@ public static function first(
200200
}
201201
};
202202

203-
204203
return new MongolidUserProvider($this->hasher, get_class($model));
205204
}
206205
}

0 commit comments

Comments
 (0)