Skip to content

Commit deb881e

Browse files
committed
Apply fixes from StyleCI
1 parent 7c384ef commit deb881e

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

Entity/GroupManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function getPager(array $criteria, $page, $limit = 10, array $sort = [])
4545
}
4646
}
4747

48-
if (count($sort) == 0) {
48+
if (0 == count($sort)) {
4949
$sort = ['name' => 'ASC'];
5050
}
5151

Entity/UserManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function getPager(array $criteria, $page, $limit = 10, array $sort = [])
117117
throw new \RuntimeException(sprintf("Invalid sort field '%s' in '%s' class", $field, $this->class));
118118
}
119119
}
120-
if (count($sort) == 0) {
120+
if (0 == count($sort)) {
121121
$sort = ['username' => 'ASC'];
122122
}
123123
foreach ($sort as $field => $direction) {

Form/Transformer/RestoreRolesTransformer.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ public function setOriginalRoles(array $originalRoles = null)
4747
*/
4848
public function transform($value)
4949
{
50-
if ($value === null) {
50+
if (null === $value) {
5151
return $value;
5252
}
5353

54-
if ($this->originalRoles === null) {
54+
if (null === $this->originalRoles) {
5555
throw new \RuntimeException('Invalid state, originalRoles array is not set');
5656
}
5757

@@ -63,7 +63,7 @@ public function transform($value)
6363
*/
6464
public function reverseTransform($selectedRoles)
6565
{
66-
if ($this->originalRoles === null) {
66+
if (null === $this->originalRoles) {
6767
throw new \RuntimeException('Invalid state, originalRoles array is not set');
6868
}
6969

GoogleAuthenticator/RequestListener.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ public function onCoreRequest(GetResponseEvent $event)
8383
return;
8484
}
8585

86-
if ($session->get($key) === true) {
86+
if (true === $session->get($key)) {
8787
return;
8888
}
8989

9090
$state = 'init';
91-
if ($request->getMethod() == 'POST') {
92-
if ($this->helper->checkCode($user, $request->get('_code')) == true) {
91+
if ('POST' == $request->getMethod()) {
92+
if (true == $this->helper->checkCode($user, $request->get('_code'))) {
9393
$session->set($key, true);
9494

9595
return;

Security/Authorization/Voter/UserAclVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function supportsClass($class)
3131
*/
3232
public function supportsAttribute($attribute)
3333
{
34-
return $attribute === 'EDIT' || $attribute === 'DELETE';
34+
return 'EDIT' === $attribute || 'DELETE' === $attribute;
3535
}
3636

3737
/**

Security/EditableRolesBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function getRoles()
9090
// TODO get the base role from the admin or security handler
9191
$baseRole = $securityHandler->getBaseRole($admin);
9292

93-
if (strlen($baseRole) == 0) { // the security handler related to the admin does not provide a valid string
93+
if (0 == strlen($baseRole)) { // the security handler related to the admin does not provide a valid string
9494
continue;
9595
}
9696

0 commit comments

Comments
 (0)