Skip to content

Commit

Permalink
Fix empty params
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Gladyshev committed Jan 7, 2021
1 parent 3564a74 commit 54c8623
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 6 additions & 2 deletions src/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
1 change: 0 additions & 1 deletion src/Transport/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
namespace Yandex\Direct\Transport;

use Yandex\Direct\ConfigurableTrait;
use Yandex\Direct\Exception\InvalidArgumentException;

/**
* Class TransportRequest
Expand Down

0 comments on commit 54c8623

Please sign in to comment.