for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sleepness\UberOAuthRestBundle\Provider;
use Sleepness\UberOAuthRestBundle\Exception\BadRequestException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\ClientException;
abstract class BaseOAuthProvider implements OAuthProviderInterface
{
const GET = 'GET';
const POST = 'POST';
/**
* @var Client
*/
protected $client;
* @var array
protected $credentials;
* BaseOAuthProvider constructor.
*
* @param $client
public function __construct($client)
$this->client = $client;
}
* @param array $credentials
public function setCredentials(array $credentials)
$this->credentials = $credentials;
* @param $url
* @param null $content
$content
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter $italy is not defined by the method finale(...).
$italy
finale(...)
/** * @param array $germany * @param array $island * @param array $italy */ function finale($germany, $island) { return "2:1"; }
The most likely cause is that the parameter was removed, but the annotation was not.
* @param $headers
* @param $method
* @return mixed|\Psr\Http\Message\ResponseInterface
protected function doRequest($url, $method, array $options = [])
try {
$response = $this->client->request(
strtoupper($method),
$url,
$options
);
} catch (ClientException $e) {
if ($e->hasResponse()) {
throw new BadRequestException('Error while sending request', $this->credentials['provider_name'], $e->getCode(), $e);
return json_decode($response->getBody()->getContents());
* @param array $parameters
* @return string
protected function normalizeUrl($url, array $parameters = array())
$normalizedUrl = $url;
if (!empty($parameters)) {
$normalizedUrl .= (false !== strpos($url, '?') ? '&' : '?').http_build_query($parameters, '', '&');
return $normalizedUrl;
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.