fix tests

This commit is contained in:
Dennis Eichhorn 2023-09-25 21:55:20 +00:00
parent 3f3ec8b697
commit 2dbaeba97e

View File

@ -133,7 +133,6 @@ abstract class RequestAbstract implements MessageInterface
public function getDataString(string $key) : ?string public function getDataString(string $key) : ?string
{ {
$key = \mb_strtolower($key); $key = \mb_strtolower($key);
if (($this->data[$key] ?? '') === '') { if (($this->data[$key] ?? '') === '') {
return null; return null;
} }
@ -153,7 +152,6 @@ abstract class RequestAbstract implements MessageInterface
public function getDataInt(string $key) : ?int public function getDataInt(string $key) : ?int
{ {
$key = \mb_strtolower($key); $key = \mb_strtolower($key);
if (($this->data[$key] ?? '') === '') { if (($this->data[$key] ?? '') === '') {
return null; return null;
} }
@ -173,7 +171,6 @@ abstract class RequestAbstract implements MessageInterface
public function getDataFloat(string $key) : ?float public function getDataFloat(string $key) : ?float
{ {
$key = \mb_strtolower($key); $key = \mb_strtolower($key);
if (($this->data[$key] ?? '') === '') { if (($this->data[$key] ?? '') === '') {
return null; return null;
} }
@ -193,7 +190,6 @@ abstract class RequestAbstract implements MessageInterface
public function getDataBool(string $key) : ?bool public function getDataBool(string $key) : ?bool
{ {
$key = \mb_strtolower($key); $key = \mb_strtolower($key);
if (($this->data[$key] ?? '') === '') { if (($this->data[$key] ?? '') === '') {
return null; return null;
} }
@ -231,13 +227,11 @@ abstract class RequestAbstract implements MessageInterface
public function getDataJson(string $key) : array public function getDataJson(string $key) : array
{ {
$key = \mb_strtolower($key); $key = \mb_strtolower($key);
if (($this->data[$key] ?? '') === '') { if (($this->data[$key] ?? '') === '') {
return []; return [];
} }
$json = \json_decode($this->data[$key], true); /** @phpstan-ignore-line */ $json = \json_decode($this->data[$key], true); /** @phpstan-ignore-line */
if ($json === null) { if ($json === null) {
$json = $this->data[$key]; $json = $this->data[$key];
} }
@ -258,14 +252,12 @@ abstract class RequestAbstract implements MessageInterface
public function getDataList(string $key, string $delim = ',') : array public function getDataList(string $key, string $delim = ',') : array
{ {
$key = \mb_strtolower($key); $key = \mb_strtolower($key);
if (($this->data[$key] ?? '') === '') { if (($this->data[$key] ?? '') === '') {
return []; return [];
} }
/* @phpstan-ignore-next-line */ /* @phpstan-ignore-next-line */
$list = \explode($delim, $this->data[$key]); $list = \explode($delim, $this->data[$key]);
if ($list === false) { if ($list === false) {
return []; // @codeCoverageIgnore return []; // @codeCoverageIgnore
} }