Skip to content

Commit 5735348

Browse files
committed
phpcs fix
1 parent 3e53169 commit 5735348

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/Controller/Component/LoginComponent.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
declare(strict_types=1);
43

54
/**
@@ -14,9 +13,7 @@
1413

1514
namespace CakeDC\Users\Controller\Component;
1615

17-
use Authentication\AuthenticationServiceInterface;
1816
use Authentication\Authenticator\ResultInterface;
19-
use Authentication\Identifier\IdentifierCollection;
2017
use Cake\Controller\Component;
2118
use Cake\Core\Configure;
2219
use Cake\Datasource\EntityInterface;
@@ -214,7 +211,7 @@ protected function handlePasswordRehash($service, $user, \Cake\Http\ServerReques
214211
continue;
215212
}
216213
/**
217-
* @var IdentifierCollection $identifierCollection
214+
* @var \Authentication\Identifier\IdentifierCollection $identifierCollection
218215
*/
219216
$identifierCollection = $service->authenticators()->get($authenticatorName)->getIdentifier();
220217
if (!$identifierCollection->has($identifierName)) {
@@ -230,6 +227,12 @@ protected function handlePasswordRehash($service, $user, \Cake\Http\ServerReques
230227
}
231228
}
232229

230+
/**
231+
* @param mixed $checker
232+
* @param \Cake\Http\ServerRequest $request
233+
* @param \Cake\Datasource\EntityInterface $user
234+
* @return void
235+
*/
233236
protected function saveRehashedPassword($checker, ServerRequest $request, EntityInterface $user): void
234237
{
235238
if (!$checker || method_exists($checker, 'needsPasswordRehash') && !$checker->needsPasswordRehash()) {
@@ -241,6 +244,7 @@ protected function saveRehashedPassword($checker, ServerRequest $request, Entity
241244
$user->setDirty('modified');
242245
if (!method_exists($this->getController(), 'getUsersTable')) {
243246
Log::warning("Error saving user id $user->id password after rehashing: getUsersTable method not found");
247+
244248
return;
245249
}
246250
if (!$this->getController()->getUsersTable()->save($user)) {

tests/TestCase/Controller/Component/LoginComponentTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
declare(strict_types=1);
43

54
/**
@@ -19,12 +18,10 @@
1918
use Authentication\Identity;
2019
use Cake\Controller\ComponentRegistry;
2120
use Cake\Controller\Controller;
22-
use Cake\Core\Configure;
2321
use Cake\Http\ServerRequest;
2422
use Cake\ORM\Entity;
2523
use Cake\TestSuite\TestCase;
2624
use CakeDC\Users\Controller\Component\LoginComponent;
27-
use CakeDC\Users\Controller\Component\SetupComponent;
2825

2926
class LoginComponentTest extends TestCase
3027
{

0 commit comments

Comments
 (0)