Skip to content

Commit 7e326ae

Browse files
committed
Some code polishing.
1 parent b2db610 commit 7e326ae

File tree

2 files changed

+9
-23
lines changed

2 files changed

+9
-23
lines changed

app/V1Module/presenters/RegistrationPresenter.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@
1818
use App\Model\Entity\Instance;
1919
use App\Model\Repository\Groups;
2020
use App\Model\Repository\Logins;
21-
use App\Model\Repository\ExternalLogins;
2221
use App\Model\Repository\Instances;
2322
use App\Model\View\UserViewFactory;
2423
use App\Security\AccessManager;
25-
use App\Helpers\ExternalLogin\ExternalServiceAuthenticator;
2624
use App\Helpers\EmailVerificationHelper;
2725
use App\Helpers\RegistrationConfig;
2826
use App\Helpers\InvitationHelper;
@@ -47,12 +45,6 @@ class RegistrationPresenter extends BasePresenter
4745
*/
4846
public $logins;
4947

50-
/**
51-
* @var ExternalLogins
52-
* @inject
53-
*/
54-
public $externalLogins;
55-
5648
/**
5749
* @var AccessManager
5850
* @inject
@@ -71,12 +63,6 @@ class RegistrationPresenter extends BasePresenter
7163
*/
7264
public $groups;
7365

74-
/**
75-
* @var ExternalServiceAuthenticator
76-
* @inject
77-
*/
78-
public $externalServiceAuthenticator;
79-
8066
/**
8167
* @var EmailVerificationHelper
8268
* @inject

app/V1Module/presenters/UsersPresenter.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,20 +351,20 @@ private function changeUserEmail(User $user, ?string $email)
351351
* Change first name and last name and check if user can change them.
352352
* @param User $user
353353
* @param null|string $titlesBefore
354-
* @param null|string $firstname
355-
* @param null|string $lastname
354+
* @param null|string $firstName
355+
* @param null|string $lastName
356356
* @param null|string $titlesAfter
357357
* @throws ForbiddenRequestException
358358
*/
359359
private function changePersonalData(
360360
User $user,
361361
?string $titlesBefore,
362-
?string $firstname,
363-
?string $lastname,
362+
?string $firstName,
363+
?string $lastName,
364364
?string $titlesAfter
365365
) {
366366
if (
367-
($titlesBefore !== null || $firstname !== null || $lastname !== null || $titlesAfter !== null) &&
367+
($titlesBefore !== null || $firstName !== null || $lastName !== null || $titlesAfter !== null) &&
368368
!$this->userAcl->canUpdatePersonalData($user)
369369
) {
370370
throw new ForbiddenRequestException("You cannot update personal data");
@@ -374,12 +374,12 @@ private function changePersonalData(
374374
$user->setTitlesBeforeName(trim($titlesBefore));
375375
}
376376

377-
if ($firstname && trim($firstname)) {
378-
$user->setFirstName(trim($firstname));
377+
if ($firstName && trim($firstName)) {
378+
$user->setFirstName(trim($firstName));
379379
}
380380

381-
if ($lastname && trim($lastname)) {
382-
$user->setLastName(trim($lastname));
381+
if ($lastName && trim($lastName)) {
382+
$user->setLastName(trim($lastName));
383383
}
384384

385385
if ($titlesAfter !== null) {

0 commit comments

Comments
 (0)