Skip to content

Commit

Permalink
[ns-panel-connector][devices-module] Fixing separate configuration (#…
Browse files Browse the repository at this point in the history
…138)
  • Loading branch information
actions-user committed Aug 9, 2023
1 parent 64272c7 commit 541b102
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/API/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
namespace FastyBird\Connector\NsPanel\API;

use FastyBird\Connector\NsPanel\Exceptions;
use InvalidArgumentException;
use RingCentral\Psr7;
use RuntimeException;
use Sunrise\Http;
use Throwable;

/**
* HTTP request
Expand All @@ -28,7 +28,7 @@
*
* @author Adam Kadlec <adam.kadlec@fastybird.com>
*/
class Request extends Http\Message\Request
class Request extends Psr7\Request
{

/**
Expand All @@ -44,17 +44,8 @@ public function __construct(
)
{
try {
$stream = null;

if ($body !== null) {
$stream = new Http\Message\Stream\PhpTempStream();

$stream->write($body);
$stream->rewind();
}

parent::__construct($method, $uri, $headers, $stream);
} catch (Throwable $ex) {
parent::__construct($method, $uri, $headers, $body);
} catch (InvalidArgumentException $ex) {
throw new Exceptions\InvalidArgument('Request could not be created', $ex->getCode(), $ex);
}
}
Expand Down
2 changes: 2 additions & 0 deletions tools/phpstan.src.neon
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ parameters:

ignoreErrors:
- message: '#^Parameter \#1 \$value of function strval expects bool\|float\|int\|resource\|string\|null, mixed given.#'
- message: '#^Parameter \#1 \$value of function floatval expects array\|bool\|float\|int\|resource\|string\|null, mixed given.#'
- message: '#^Parameter \#3 \$headers of method RingCentral\\Psr7\\Request::__construct\(\) expects array, array\<string, array\<string\>\|string\>\|null given.#'

0 comments on commit 541b102

Please sign in to comment.