mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-05 12:08:42 +00:00
fix tests
This commit is contained in:
parent
3f3ec8b697
commit
2dbaeba97e
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user