for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace DH\NavigationBundle\Provider\GoogleMaps;
use DH\NavigationBundle\Contract\DistanceMatrix\DistanceMatrixQueryInterface;
use DH\NavigationBundle\Provider\AbstractProvider;
use DH\NavigationBundle\Provider\GoogleMaps\DistanceMatrix\DistanceMatrixQuery;
use GuzzleHttp\ClientInterface;
class GoogleMaps extends AbstractProvider
{
/**
* @var string
*/
private $api_key;
* @var ?string
private $region;
* Here constructor.
*
* @param ClientInterface $client
* @param string $apiKey an Api key
* @param ?string $region region
public function __construct(ClientInterface $client, string $apiKey, ?string $region = null)
$region
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function __construct(ClientInterface $client, string $apiKey, /** @scrutinizer ignore-unused */ ?string $region = null)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
parent::__construct($client);
$this->api_key = $apiKey;
}
* @return string
public function getName(): string
return 'google_maps';
public function getApiKey(): string
return $this->api_key;
* @return ?string
public function getRegion(): ?string
return $this->region;
* @return array
public function getCredentials(): array
return [
'key' => $this->getApiKey(),
];
* @return DistanceMatrixQueryInterface
public function createDistanceMatrixQuery(): DistanceMatrixQueryInterface
return new DistanceMatrixQuery($this);
public function __toString()
return $this->getName();
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.