Missing use statement should be avoided

  • Major
  • Bugrisk

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

  • Minor
  • Bugrisk

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. );

PHP code should not contain unreachable code

  • Minor
  • Deadcode

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

  1. {
  2. return $this->configRetriever->fromServices(
  3. $providerName, $providerClass::additionalConfigKeys()
  4. );
  5. return new Config(
  6. $this->spoofedConfig['client_id'],
  7. $this->spoofedConfig['client_secret'],
  8. $this->spoofedConfig['redirect']
  9. );

    This code is unreachable.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by Brian Faust
  10. }
  11. /**
  12. * Check if a server is given, which indicates that OAuth1 is used.
  13. *