Skip to content

Commit ed360ed

Browse files
committed
Fix PHP CS
1 parent 53de040 commit ed360ed

File tree

3 files changed

+10
-14
lines changed

3 files changed

+10
-14
lines changed

core/userrights.class.inc.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,7 @@ public function DoCheckToWrite()
427427
$this->m_aCheckIssues[] = Dict::S('Class:User/Error:AdminProfileCannotBeRemovedBySelf');
428428
}
429429
}
430-
}
431-
elseif ($this->IsPrivilegedUser()) {
430+
} elseif ($this->IsPrivilegedUser()) {
432431
// Prevent Privileged User to be saved with profiles denying the access to the backoffice
433432
$oSet->Rewind();
434433
while ($oUserProfile = $oSet->Fetch()) {

tests/php-unit-tests/src/BaseTestCase/ItopDataTestCase.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -661,17 +661,15 @@ protected function RemoveProfileFromUser($oUser, $iProfileId)
661661
{
662662
/** @var \ormLinkSet $oSet */
663663
$oSet = $oUser->Get('profile_list');
664-
foreach ($oSet as $oUserProfile)
665-
{
666-
if ($oUserProfile->Get('profileid') == $iProfileId)
667-
{
664+
foreach ($oSet as $oUserProfile) {
665+
if ($oUserProfile->Get('profileid') == $iProfileId) {
668666
$oSet->RemoveItem($oUserProfile->GetKey());
669667
break;
670668
}
671669
}
672-
$oUser = $this->updateObject(User::class, $oUser->GetKey(), array(
670+
$oUser = $this->updateObject(User::class, $oUser->GetKey(), [
673671
'profile_list' => $oSet,
674-
));
672+
]);
675673
return $oUser;
676674
}
677675

tests/php-unit-tests/unitary-tests/core/UserRightsTest.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,12 @@ protected function GivenUserWithProfiles(string $sLogin, array $aProfileIds): DB
8787
foreach ($aProfileIds as $iProfileId) {
8888
$oProfiles->AddItem(MetaModel::NewObject('URP_UserProfile', ['profileid' => $iProfileId, 'reason' => 'UNIT Tests']));
8989
}
90-
$oUser = MetaModel::NewObject('UserLocal', array(
90+
$oUser = MetaModel::NewObject('UserLocal', [
9191
'login' => $sLogin,
9292
'password' => 'Password1!',
9393
'expiration' => UserLocal::EXPIRE_NEVER,
9494
'profile_list' => $oProfiles,
95-
));
95+
]);
9696
return $oUser;
9797
}
9898

@@ -336,9 +336,9 @@ public function testUserCannotElevateTheirOwnRights(int $iCurrentProfileId, int
336336
public function UserCannotElevateTheirOwnRightsProvider(): array
337337
{
338338
return [
339-
'Configuration manager to SuperUser' => ['current'=> 3, 'added' => 117],
340-
'Configuration manager to Administrator' => ['current'=> 3, 'added' => 1],
341-
'SuperUser to Administrator' => ['current'=> 117, 'added' => 1],
339+
'Configuration manager to SuperUser' => ['current' => 3, 'added' => 117],
340+
'Configuration manager to Administrator' => ['current' => 3, 'added' => 1],
341+
'SuperUser to Administrator' => ['current' => 117, 'added' => 1],
342342
];
343343
}
344344

@@ -417,7 +417,6 @@ public function testUserCannotLoseUserEditionRights(int $iProfileId)
417417
$this->RemoveProfileFromUser($oUser, $iProfileId);
418418
}
419419

420-
421420
public function UserCannotLoseUserEditionRightsProvider(): array
422421
{
423422
return [

0 commit comments

Comments
 (0)