Skip to content

Commit

Permalink
[general] Application contaner (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 30, 2024
1 parent 3633cf1 commit c644c7b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"fastybird/exchange-library": "dev-main",
"fastybird/metadata-library": "dev-main",
"nette/di": "^3.0",
"nette/utils": "^3.2",
"nette/utils": "^4.0",
"orisai/object-mapper": "^0.1",
"predis/predis": "^1.1",
"psr/event-dispatcher": "^1.0",
Expand Down
9 changes: 4 additions & 5 deletions src/Exchange/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use FastyBird\Library\Metadata\Types as MetadataTypes;
use FastyBird\Plugin\RedisDb\Events;
use FastyBird\Plugin\RedisDb\Utilities;
use Nette;
use Nette\Utils;
use Psr\EventDispatcher;
use Psr\Log;
Expand Down Expand Up @@ -63,7 +62,7 @@ public function handle(string $payload): void
$this->dispatcher?->dispatch(new Events\BeforeMessageHandled($payload));

try {
$data = Nette\Utils\Json::decode($payload, Nette\Utils\Json::FORCE_ARRAY);
$data = Utils\Json::decode($payload, forceArrays: true);

if (
is_array($data)
Expand All @@ -74,7 +73,7 @@ public function handle(string $payload): void
$this->consume(
strval($data['source']),
$data['routing_key'],
Nette\Utils\Json::encode($data['data']),
Utils\Json::encode($data['data']),
array_key_exists('sender_id', $data) ? $data['sender_id'] : null,
);

Expand All @@ -88,7 +87,7 @@ public function handle(string $payload): void
],
);
}
} catch (Nette\Utils\JsonException $ex) {
} catch (Utils\JsonException $ex) {
// Log error action reason
$this->logger->warning(
'Received message is not valid json',
Expand Down Expand Up @@ -125,7 +124,7 @@ private function consume(
}

try {
$data = Utils\Json::decode($data, Utils\Json::FORCE_ARRAY);
$data = Utils\Json::decode($data, forceArrays: true);
assert(is_array($data));
$data = Utils\ArrayHash::from($data);

Expand Down
2 changes: 1 addition & 1 deletion src/States/StateFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function create(string $class, string $raw): State
}

try {
$decoded = Utils\Json::decode($raw, Utils\Json::FORCE_ARRAY);
$decoded = Utils\Json::decode($raw, forceArrays: true);

if (!is_array($decoded)) {
throw new Exceptions\InvalidArgument('Provided state content is not valid JSON');
Expand Down

0 comments on commit c644c7b

Please sign in to comment.