Мелкофиксы в конструкторе KktMonitor

This commit is contained in:
Anthony Axenov 2021-11-22 14:52:27 +08:00
parent 00b2643f42
commit 9d3344a0df
2 changed files with 25 additions and 2 deletions

View File

@ -56,8 +56,8 @@ class KktMonitor extends AtolClient
protected function fetchAll(?int $limit = null, ?int $offset = null): KktResponse
{
$params = [];
$limit && $params['limit'] = $limit;
$offset && $params['offset'] = $offset;
!is_null($limit) && $params['limit'] = $limit;
!is_null($offset) && $params['offset'] = $offset;
return $this->sendRequest('GET', self::getUrlToMethod('cash-registers'), $params);
}

23
src/Enum.php Normal file
View File

@ -0,0 +1,23 @@
<?php
declare(strict_types = 1);
namespace AtolOnline;
use AtolOnline\Exceptions\InvalidEnumValueException;
/**
* Расширение класса перечисления
*/
class Enum extends \MyCLabs\Enum\Enum
{
/**
* @inheritDoc
* @throws InvalidEnumValueException
*/
public static function isValid($value)
{
return parent::isValid($value)
?: throw new InvalidEnumValueException(static::class, $value);
}
}