Commit 1ee86c46 authored by jcnventura's avatar jcnventura Committed by Joao Ventura

Minor coding standards

parent 042c1640
......@@ -4,7 +4,6 @@ namespace Drupal\openid_connect\Plugin\OpenIDConnectClient;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openid_connect\Plugin\OpenIDConnectClientBase;
use Exception;
/**
* Facebook OpenID Connect client.
......@@ -126,7 +125,7 @@ class OpenIDConnectFacebookClient extends OpenIDConnectClientBase {
return $userinfo;
}
catch (Exception $e) {
catch (\Exception $e) {
$variables = [
'@message' => 'Could not retrieve user profile information',
'@error_message' => $e->getMessage(),
......
......@@ -4,7 +4,6 @@ namespace Drupal\openid_connect\Plugin\OpenIDConnectClient;
use Drupal\Core\Form\FormStateInterface;
use Drupal\openid_connect\Plugin\OpenIDConnectClientBase;
use Exception;
/**
* GitHub OpenID Connect client.
......@@ -89,6 +88,7 @@ class OpenIDConnectGithubClient extends OpenIDConnectClientBase {
$client = $this->httpClient;
try {
$claims = [];
$response = $client->get($endpoints['userinfo'], $request_options);
$response_data = json_decode((string) $response->getBody(), TRUE);
......@@ -127,7 +127,7 @@ class OpenIDConnectGithubClient extends OpenIDConnectClientBase {
return $claims;
}
catch (Exception $e) {
catch (\Exception $e) {
$variables = [
'@message' => 'Could not retrieve user profile information',
'@error_message' => $e->getMessage(),
......
......@@ -15,7 +15,6 @@ use Drupal\Core\Routing\TrustedRedirectResponse;
use Drupal\Core\StringTranslation\StringTranslationTrait;
use Drupal\Core\Url;
use Drupal\openid_connect\OpenIDConnectStateToken;
use Exception;
use GuzzleHttp\ClientInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\RequestStack;
......@@ -309,7 +308,7 @@ abstract class OpenIDConnectClientBase extends PluginBase implements OpenIDConne
}
return $tokens;
}
catch (Exception $e) {
catch (\Exception $e) {
$variables = [
'@message' => 'Could not retrieve tokens',
'@error_message' => $e->getMessage(),
......@@ -349,7 +348,7 @@ abstract class OpenIDConnectClientBase extends PluginBase implements OpenIDConne
return json_decode($response_data, TRUE);
}
catch (Exception $e) {
catch (\Exception $e) {
$variables = [
'@message' => 'Could not retrieve user profile information',
'@error_message' => $e->getMessage(),
......
......@@ -5,7 +5,6 @@ namespace Drupal\openid_connect\Plugin;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
use Drupal\Core\Plugin\DefaultPluginManager;
use Traversable;
/**
* Provides the OpenID Connect client plugin manager.
......@@ -24,7 +23,7 @@ class OpenIDConnectClientManager extends DefaultPluginManager {
* The module handler to invoke the alter hook with.
*/
public function __construct(
Traversable $namespaces,
\Traversable $namespaces,
CacheBackendInterface $cache_backend,
ModuleHandlerInterface $module_handler
) {
......
......@@ -28,7 +28,6 @@ use Drupal\file\Entity\File;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\File\FileSystemInterface;
use Psr\Log\InvalidArgumentException;
use stdClass;
/**
* Class OpenIDConnectTest.
......@@ -1570,7 +1569,7 @@ class OpenIDConnectTest extends UnitTestCase {
],
[
'name' => $this->randomMachineName(),
'field_image_exception' => new stdClass(),
'field_image_exception' => new \stdClass(),
'email' => 'valid@email.com',
],
TRUE,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment