diff --git a/composer.json b/composer.json index dd4b52a..e76ed80 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ }, "require-dev": { "phpunit/phpunit": "~5.7|~6.0", - "squizlabs/php_codesniffer": "^2.3" + "squizlabs/php_codesniffer": "^3.5.8" }, "autoload": { "psr-4": { diff --git a/src/Service.php b/src/Service.php index 94ce191..2094ddd 100644 --- a/src/Service.php +++ b/src/Service.php @@ -50,9 +50,13 @@ abstract class Service implements ServiceInterface */ public function request(array $params, array $headers = []) { - $params['params'] = filter_params($params['params']); + if (!empty($params['params'])) { + $params['params'] = filter_params($params['params']); + } - /* Request API */ + if (empty($params['params'])) { + $params['params'] = new \StdClass; + } $response = $this->getTransport()->request(new Request([ 'service' => $this->getName(), diff --git a/src/Transport/Response.php b/src/Transport/Response.php index c547031..ae15abf 100644 --- a/src/Transport/Response.php +++ b/src/Transport/Response.php @@ -7,7 +7,6 @@ namespace Yandex\Direct\Transport; use Yandex\Direct\ConfigurableTrait; -use Yandex\Direct\Exception\InvalidArgumentException; /** * Class TransportRequest