for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace badams\MicrosoftTranslator\Methods;
/**
* Class Detect
* @package badams\MicrosoftTranslator\Methods
* @link https://msdn.microsoft.com/en-us/library/ff512411.aspx
*/
class Detect implements \badams\MicrosoftTranslator\ApiMethodInterface
{
* @var string
protected $text;
* 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)
$this->text = $text;
}
* @return string
public function getRequestMethod()
return 'GET';
* @return array
public function getRequestOptions()
return ['query' => ['text' => $this->text]];
* @param \GuzzleHttp\Message\ResponseInterface $response
public function processResponse(\GuzzleHttp\Message\ResponseInterface $response)
$xml = (array)simplexml_load_string($response->getBody()->getContents());
return (string)$xml[0];
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.