diff --git a/Entity/GroupManager.php b/Entity/GroupManager.php index eb07522eb..8db6d7a33 100644 --- a/Entity/GroupManager.php +++ b/Entity/GroupManager.php @@ -45,7 +45,7 @@ public function getPager(array $criteria, $page, $limit = 10, array $sort = []) } } - if (count($sort) == 0) { + if (0 == count($sort)) { $sort = ['name' => 'ASC']; } diff --git a/Entity/UserManager.php b/Entity/UserManager.php index 6116ddfda..48b39e787 100644 --- a/Entity/UserManager.php +++ b/Entity/UserManager.php @@ -117,7 +117,7 @@ public function getPager(array $criteria, $page, $limit = 10, array $sort = []) throw new \RuntimeException(sprintf("Invalid sort field '%s' in '%s' class", $field, $this->class)); } } - if (count($sort) == 0) { + if (0 == count($sort)) { $sort = ['username' => 'ASC']; } foreach ($sort as $field => $direction) { diff --git a/Form/Transformer/RestoreRolesTransformer.php b/Form/Transformer/RestoreRolesTransformer.php index 199d21706..2baebf091 100644 --- a/Form/Transformer/RestoreRolesTransformer.php +++ b/Form/Transformer/RestoreRolesTransformer.php @@ -47,11 +47,11 @@ public function setOriginalRoles(array $originalRoles = null) */ public function transform($value) { - if ($value === null) { + if (null === $value) { return $value; } - if ($this->originalRoles === null) { + if (null === $this->originalRoles) { throw new \RuntimeException('Invalid state, originalRoles array is not set'); } @@ -63,7 +63,7 @@ public function transform($value) */ public function reverseTransform($selectedRoles) { - if ($this->originalRoles === null) { + if (null === $this->originalRoles) { throw new \RuntimeException('Invalid state, originalRoles array is not set'); } diff --git a/GoogleAuthenticator/RequestListener.php b/GoogleAuthenticator/RequestListener.php index 6eda507ce..480edcc0e 100644 --- a/GoogleAuthenticator/RequestListener.php +++ b/GoogleAuthenticator/RequestListener.php @@ -83,13 +83,13 @@ public function onCoreRequest(GetResponseEvent $event) return; } - if ($session->get($key) === true) { + if (true === $session->get($key)) { return; } $state = 'init'; - if ($request->getMethod() == 'POST') { - if ($this->helper->checkCode($user, $request->get('_code')) == true) { + if ('POST' == $request->getMethod()) { + if (true == $this->helper->checkCode($user, $request->get('_code'))) { $session->set($key, true); return; diff --git a/Security/Authorization/Voter/UserAclVoter.php b/Security/Authorization/Voter/UserAclVoter.php index be197aefb..705cb53b0 100644 --- a/Security/Authorization/Voter/UserAclVoter.php +++ b/Security/Authorization/Voter/UserAclVoter.php @@ -31,7 +31,7 @@ public function supportsClass($class) */ public function supportsAttribute($attribute) { - return $attribute === 'EDIT' || $attribute === 'DELETE'; + return 'EDIT' === $attribute || 'DELETE' === $attribute; } /** diff --git a/Security/EditableRolesBuilder.php b/Security/EditableRolesBuilder.php index 328a358bd..379bda41d 100644 --- a/Security/EditableRolesBuilder.php +++ b/Security/EditableRolesBuilder.php @@ -90,7 +90,7 @@ public function getRoles() // TODO get the base role from the admin or security handler $baseRole = $securityHandler->getBaseRole($admin); - if (strlen($baseRole) == 0) { // the security handler related to the admin does not provide a valid string + if (0 == strlen($baseRole)) { // the security handler related to the admin does not provide a valid string continue; }