for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace EtherpadLite;
use Psr\Http\Message\ResponseInterface;
class Response
{
const CODE_OK = 0;
const CODE_WRONG_PARAMETERS = 1;
const CODE_INTERNAL_ERROR = 2;
const CODE_NO_SUCH_FUNCTION = 3;
const CODE_NO_OR_WRONG_API_KEY = 4;
/** @var \stdClass */
private $data;
/**
* @param ResponseInterface $response
*/
public function __construct(ResponseInterface $response)
if ($response->getStatusCode() === 200) {
$this->data = \GuzzleHttp\json_decode($response->getBody(), true);
} else {
$this->data = array();
array()
array
object<stdClass>
$data
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
}
* @return string|null
public function getCode()
return $this->getPropertyFromData('code');
public function getMessage()
return $this->getPropertyFromData('message');
public function getData()
return $this->getPropertyFromData('data');
* @return array
public function getResponse()
return $this->data;
* @param string $key
* @return mixed
private function getPropertyFromData($key)
return isset($this->data[$key]) ? $this->data[$key] : null;
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..