Add PHPstan and fix all checks for max level

This commit is contained in:
2021-10-21 13:29:50 +09:00
parent 18cf3330df
commit c2721cb8d4
13 changed files with 140 additions and 116 deletions

View File

@@ -28,31 +28,26 @@ class CancelResponse
/**
* Amazon Gift Card Raw JSON
*
* @var string
* @var array<mixed>
*/
protected $raw_json;
/**
* @var array
*/
protected $log;
/**
* Response constructor.
* @param array $json_response
* @param array<mixed> $json_response
*/
public function __construct(array $json_response)
{
$this->raw_json = $json_response;
$this->log = AmazonDebug::getLog(AmazonDebug::getId());
$this->parseJsonResponse($json_response);
}
/**
* @return array
* @return array<mixed>
*/
public function getLog(): array
{
return $this->log;
return AmazonDebug::getLog(AmazonDebug::getId());
}
/**
@@ -84,11 +79,11 @@ class CancelResponse
*/
public function getRawJson(): string
{
return json_encode($this->raw_json);
return (json_encode($this->raw_json)) ?: '';
}
/**
* @param array $json_response
* @param array<mixed> $json_response
* @return CancelResponse
*/
public function parseJsonResponse(array $json_response): self