for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Marek\OpenWeatherMap\Core\Weather;
use Marek\OpenWeatherMap\API\Cache\HandlerInterface;
use Marek\OpenWeatherMap\API\Exception\APIException;
use Marek\OpenWeatherMap\API\Exception\ExceptionThrower;
use Marek\OpenWeatherMap\Denormalizer\DenormalizerInterface;
use Marek\OpenWeatherMap\Factory\UrlFactory;
use Marek\OpenWeatherMap\Http\Client\HttpClientInterface;
abstract class Base
{
/**
* @var HttpClientInterface
*/
protected $client;
* @var UrlFactory
protected $factory;
* @var HandlerInterface
protected $handler;
* @var \Marek\OpenWeatherMap\Denormalizer\DenormalizerInterface
protected $denormalizer;
* Base constructor.
*
* @param HttpClientInterface $client
* @param UrlFactory $factory
* @param HandlerInterface $handler
* @param \Marek\OpenWeatherMap\Denormalizer\DenormalizerInterface $hydrator
$hydrator
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.
public function __construct(HttpClientInterface $client, UrlFactory $factory, HandlerInterface $handler, DenormalizerInterface $denormalizer)
$this->client = $client;
$this->factory = $factory;
$this->handler = $handler;
$this->denormalizer = $denormalizer;
}
* @param string $url
* @throws APIException
* @return array
protected function getResult(string $url): array
if ($this->handler->has($url)) {
return $this->handler->get($url);
$response = $this->client->get($url);
ExceptionThrower::throwException($response->getStatusCode(), $response->getMessage());
return $response->getData();
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.