Missing use statement should be avoided

More information: https://insight.symfony.com/what-we-analyse/php.missing_use_statement

  1. if ($user instanceof User) {
  2. parse_str($token['credentialsResponseBody'], $credentialsResponseBody);
  3. if (!$credentialsResponseBody || !is_array($credentialsResponseBody)) {
  4. throw new CredentialsException('Unable to parse token credentials response.');

    The CredentialsException class resolves to the following class: League\OAuth1\Client\Credentials\CredentialsException.
    Did you forget to add a corresponding use statement?

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by DraperStudio
  5. }
  6. $user->setAccessTokenResponseBody($credentialsResponseBody);
  7. }

Object parameters should be type hinted

More information: https://insight.symfony.com/what-we-analyse/php.object_parameter_not_type_hinted

  1. *
  2. * @return \SocialiteProviders\Manager\Contracts\ConfigInterface
  3. *
  4. * @throws \SocialiteProviders\Manager\Exception\MissingConfigException
  5. */
  6. protected function getConfig($providerClass, $providerName)

    The parameter providerClass, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Andy Wendt
  7. {
  8. return $this->configRetriever->fromServices(
  9. $providerName, $providerClass::additionalConfigKeys()
  10. );
  11. }

Unused method, property, variable or parameter

More information: https://insight.symfony.com/what-we-analyse/php.unused_local_variable_or_private_member

  1. private $configRetriever;
  2. /**
  3. * @var array
  4. */
  5. private $spoofedConfig = [

    This spoofedConfig attribute is declared but never used. You should remove it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by Brian Faust
  6. 'client_id' => 'spoofed_client_id',
  7. 'client_secret' => 'spoofed_client_secret',
  8. 'redirect' => 'spoofed_redirect',
  9. ];