for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace badams\MicrosoftTranslator\Methods;
/**
* Class Speak
* @package badams\MicrosoftTranslator\Methods
* @link https://msdn.microsoft.com/en-us/library/ff512420.aspx
*/
class Speak implements \badams\MicrosoftTranslator\ApiMethodInterface
{
const FORMAT_MP3 = 'audio/mp3';
const FORMAT_WAV = 'audio/wav';
const OPTION_MAX_QUALITY = 'MaxQuality';
const OPTION_MIN_SIZE = 'MinSize';
* @var string
protected $language;
protected $text;
protected $format;
protected $options;
* Translate constructor.
* @param $text
* @param $to
* @param null $from
$from
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($text, $language, $format = Speak::FORMAT_MP3, $options = Speak::OPTION_MAX_QUALITY)
$this->text = $text;
$this->language = $language;
$this->format = $format;
$this->options = $options;
}
* @return string
public function getRequestMethod()
return 'GET';
* @return array
public function getRequestOptions()
return ['query' => [
'text' => $this->text,
'language' => $this->language,
'format' => $this->format,
'options' => $this->options,
]];
* @param \GuzzleHttp\Message\ResponseInterface $response
public function processResponse(\GuzzleHttp\Message\ResponseInterface $response)
return base64_encode($response->getBody()->getContents());
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.