Skip to content

Commit

Permalink
Apply php-cs-fixer
Browse files Browse the repository at this point in the history
Legend: ?-unknown, I-invalid file syntax, file ignored, S-Skipped, .-no
changes, F-fixed, E-error
   1) Form/FOSUBRegistrationFormHandler.php (yoda_style)
   2)
DependencyInjection/CompilerPass/SetResourceOwnerServiceNameCompilerPass.php
(yoda_style)
   3) OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php (yoda_style)
   4) Security/OAuthUtils.php (yoda_style)
   5) Security/Core/User/OAuthUserProvider.php (yoda_style)
  • Loading branch information
soullivaneuh committed Sep 28, 2017
1 parent 4c2c38c commit 9893aab
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class SetResourceOwnerServiceNameCompilerPass implements CompilerPassInterface
public function process(ContainerBuilder $container)
{
foreach (array_keys($container->getAliases()) as $alias) {
if (strpos($alias, 'hwi_oauth.resource_owner.') !== 0) {
if (0 !== strpos($alias, 'hwi_oauth.resource_owner.')) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions Form/FOSUBRegistrationFormHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ protected function getUniqueUserName($name)

do {
$user = $this->userManager->findUserByUsername($testName);
} while ($user !== null && $i < $this->iterations && $testName = $name.++$i);
} while (null !== $user && $i < $this->iterations && $testName = $name.++$i);

return $user !== null ? '' : $testName;
return null !== $user ? '' : $testName;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function getRequestToken($redirectUri, array $extraParameters = array())
throw new AuthenticationException(sprintf('OAuth error: "%s"', $response['oauth_problem']));
}

if (isset($response['oauth_callback_confirmed']) && $response['oauth_callback_confirmed'] !== 'true') {
if (isset($response['oauth_callback_confirmed']) && 'true' !== $response['oauth_callback_confirmed']) {
throw new AuthenticationException('Defined OAuth callback was not confirmed.');
}

Expand Down
2 changes: 1 addition & 1 deletion Security/Core/User/OAuthUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public function refreshUser(UserInterface $user)
*/
public function supportsClass($class)
{
return $class === 'HWI\\Bundle\\OAuthBundle\\Security\\Core\\User\\OAuthUser';
return 'HWI\\Bundle\\OAuthBundle\\Security\\Core\\User\\OAuthUser' === $class;
}
}
2 changes: 1 addition & 1 deletion Security/OAuthUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static function signRequest($method, $url, $parameters, $clientSecret, $t
throw new \RuntimeException('RSA-SHA1 signature method requires the OpenSSL extension.');
}

if (strpos($clientSecret, '-----BEGIN') === 0) {
if (0 === strpos($clientSecret, '-----BEGIN')) {
$privateKey = openssl_pkey_get_private($clientSecret, $tokenSecret);
} else {
$privateKey = openssl_pkey_get_private(file_get_contents($clientSecret), $tokenSecret);
Expand Down

0 comments on commit 9893aab

Please sign in to comment.