Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh committed Nov 2, 2017
1 parent 7c384ef commit deb881e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Entity/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}

Expand Down
2 changes: 1 addition & 1 deletion Entity/UserManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions Form/Transformer/RestoreRolesTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand All @@ -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');
}

Expand Down
6 changes: 3 additions & 3 deletions GoogleAuthenticator/RequestListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Security/Authorization/Voter/UserAclVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function supportsClass($class)
*/
public function supportsAttribute($attribute)
{
return $attribute === 'EDIT' || $attribute === 'DELETE';
return 'EDIT' === $attribute || 'DELETE' === $attribute;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Security/EditableRolesBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit deb881e

Please sign in to comment.