diff --git a/src/FacebookPostAuthManager.php b/src/FacebookPostAuthManager.php index 015722016..2f8dc0004 100644 --- a/src/FacebookPostAuthManager.php +++ b/src/FacebookPostAuthManager.php @@ -2,6 +2,7 @@ namespace Drupal\social_post_facebook; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\Session; use Drupal\social_post\PostManager; @@ -23,7 +24,7 @@ class FacebookPostAuthManager extends PostManager\OAuth2Manager { * * @var \League\OAuth2\Client\Provider\Facebook */ - protected $client; + protected mixed $client; /** * The HTTP client object. @@ -38,7 +39,7 @@ class FacebookPostAuthManager extends PostManager\OAuth2Manager { * * @var \Symfony\Component\HttpFoundation\Request */ - protected $request; + protected ?Request $request; /** * The Facebook access token. @@ -71,12 +72,13 @@ public function authenticate() { /** * {@inheritdoc} */ - public function getAuthorizationUrl() { + public function getAuthorizationUrl(): mixed { $config = \Drupal::config('social_post_facebook.settings'); $config_id = $config->get('config_id'); if ($config_id) { $options = ['config_id' => $config_id]; - } else { + } + else { $options = ['scopes' => ['email']]; } $login_url = $this->client->getAuthorizationUrl($options); @@ -90,7 +92,7 @@ public function getAuthorizationUrl() { * @return League\OAuth2\Client\Provider\FacebookUser * User Info returned by the facebook. */ - public function getUserInfo() { + public function getUserInfo(): mixed { $this->user = $this->client->getResourceOwner($this->token); return [ 'user' => $this->user, @@ -104,7 +106,7 @@ public function getUserInfo() { * @return string * Used for making API calls. */ - public function getAccessToken() { + public function getAccessToken(): mixed { return $this->token; } @@ -135,7 +137,7 @@ public function requestApiCall($message, $token) { * @return string * Absolute Google login URL where user will be redirected */ - public function getState() { + public function getState(): string { $state = $this->client->getState(); // Generate and return the URL where we should redirect the user. -- 2.39.5 (Apple Git-154)