Skip to content

Commit

Permalink
[core] Reorganizing project packages (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Nov 25, 2024
1 parent bd4bef2 commit 80ff36d
Show file tree
Hide file tree
Showing 42 changed files with 320 additions and 308 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@
"contributte/translation": "^2.0",
"cweagans/composer-patches": "^1.7",
"doctrine/orm": "2.15.*",
"fastybird/application-library": "dev-main",
"fastybird/application": "dev-main",
"fastybird/devices-module": "dev-main",
"fastybird/metadata-library": "dev-main",
"fastybird/tools-library": "dev-main",
"fastybird/tools": "dev-main",
"fig/http-message-util": "^1.1",
"guzzlehttp/guzzle": "^7.5",
"ipub/doctrine-crud": "^5.0",
"nette/di": "^3.0",
"nette/di": "^3.2",
"orisai/object-mapper": "^0.2",
"psr/log": "^3.0",
"ramsey/uuid": "^4.5",
"ramsey/uuid": "^4.7",
"react/async": "^4.0",
"react/datagram": "^1.8",
"react/event-loop": "^1.3",
Expand Down
6 changes: 3 additions & 3 deletions src/API/ConnectionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use FastyBird\Connector\Viera\Documents;
use FastyBird\Connector\Viera\Exceptions;
use FastyBird\Connector\Viera\Helpers;
use FastyBird\Library\Metadata\Exceptions as MetadataExceptions;
use FastyBird\Core\Tools\Exceptions as ToolsExceptions;
use FastyBird\Module\Devices\Exceptions as DevicesExceptions;
use Nette;
use Throwable;
Expand Down Expand Up @@ -54,8 +54,8 @@ public function __construct(
/**
* @throws DevicesExceptions\InvalidState
* @throws Exceptions\InvalidArgument
* @throws MetadataExceptions\InvalidArgument
* @throws MetadataExceptions\InvalidState
* @throws ToolsExceptions\InvalidArgument
* @throws ToolsExceptions\InvalidState
* @throws TypeError
* @throws ValueError
*/
Expand Down
8 changes: 4 additions & 4 deletions src/API/TelevisionApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
use FastyBird\Connector\Viera\Helpers;
use FastyBird\Connector\Viera\Services;
use FastyBird\Connector\Viera\Types;
use FastyBird\Core\Tools\Helpers as ToolsHelpers;
use FastyBird\DateTimeFactory;
use FastyBird\Library\Application\Helpers as ApplicationHelpers;
use FastyBird\Library\Metadata\Types as MetadataTypes;
use Fig\Http\Message\RequestMethodInterface;
use GuzzleHttp;
Expand Down Expand Up @@ -1420,7 +1420,7 @@ function (Socket\ConnectionInterface $connection): void {
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-api',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'device' => [
'identifier' => $this->identifier,
],
Expand All @@ -1447,7 +1447,7 @@ function (Socket\ConnectionInterface $connection): void {
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-api',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'device' => [
'identifier' => $this->identifier,
],
Expand Down Expand Up @@ -1525,7 +1525,7 @@ private function unsubscribeEvents(): void
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-api',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'device' => [
'identifier' => $this->identifier,
],
Expand Down
14 changes: 7 additions & 7 deletions src/Clients/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
use FastyBird\Connector\Viera\Queue;
use FastyBird\Connector\Viera\Services;
use FastyBird\Connector\Viera\ValueObjects;
use FastyBird\Library\Application\Helpers as ApplicationHelpers;
use FastyBird\Core\Tools\Helpers as ToolsHelpers;
use FastyBird\Library\Metadata\Types as MetadataTypes;
use FastyBird\Module\Devices\Events as DevicesEvents;
use Nette;
Expand Down Expand Up @@ -117,7 +117,7 @@ public function discover(): void
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'discovery-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
],
);

Expand Down Expand Up @@ -155,7 +155,7 @@ public function discover(): void
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'discovery-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
],
);
}
Expand Down Expand Up @@ -240,7 +240,7 @@ private function handleDiscoveredDevice(string $id, string $host, int $port): vo
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'discovery-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'device' => [
'id' => $id,
'host' => $host,
Expand Down Expand Up @@ -290,7 +290,7 @@ private function handleDiscoveredDevice(string $id, string $host, int $port): vo
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'discovery-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
],
);

Expand All @@ -301,7 +301,7 @@ private function handleDiscoveredDevice(string $id, string $host, int $port): vo
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'discovery-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'request' => [
'method' => $ex->getRequest()?->getMethod(),
'url' => $ex->getRequest() !== null ? strval($ex->getRequest()->getUri()) : null,
Expand All @@ -320,7 +320,7 @@ private function handleDiscoveredDevice(string $id, string $host, int $port): vo
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'discovery-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
],
);

Expand Down
62 changes: 33 additions & 29 deletions src/Clients/Television.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
use FastyBird\Connector\Viera\Queries;
use FastyBird\Connector\Viera\Queue;
use FastyBird\Connector\Viera\Types;
use FastyBird\Core\Application\Exceptions as ApplicationExceptions;
use FastyBird\Core\Tools\Exceptions as ToolsExceptions;
use FastyBird\Core\Tools\Helpers as ToolsHelpers;
use FastyBird\DateTimeFactory;
use FastyBird\Library\Application\Helpers as ApplicationHelpers;
use FastyBird\Library\Metadata\Exceptions as MetadataExceptions;
use FastyBird\Library\Metadata\Types as MetadataTypes;
use FastyBird\Library\Tools\Exceptions as ToolsExceptions;
use FastyBird\Module\Devices\Documents as DevicesDocuments;
use FastyBird\Module\Devices\Exceptions as DevicesExceptions;
use FastyBird\Module\Devices\Models as DevicesModels;
Expand Down Expand Up @@ -100,15 +100,16 @@ public function __construct(
}

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws ApplicationExceptions\Mapping
* @throws ApplicationExceptions\MalformedInput
* @throws DevicesExceptions\InvalidArgument
* @throws DevicesExceptions\InvalidState
* @throws Exceptions\InvalidArgument
* @throws Exceptions\Runtime
* @throws MetadataExceptions\InvalidArgument
* @throws MetadataExceptions\InvalidState
* @throws MetadataExceptions\Mapping
* @throws MetadataExceptions\MalformedInput
* @throws ToolsExceptions\InvalidArgument
* @throws ToolsExceptions\InvalidState
* @throws TypeError
* @throws ValueError
*/
Expand Down Expand Up @@ -198,15 +199,16 @@ public function disconnect(): void
}

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws ApplicationExceptions\Mapping
* @throws ApplicationExceptions\MalformedInput
* @throws DevicesExceptions\InvalidArgument
* @throws DevicesExceptions\InvalidState
* @throws Exceptions\InvalidArgument
* @throws Exceptions\Runtime
* @throws MetadataExceptions\InvalidArgument
* @throws MetadataExceptions\InvalidState
* @throws MetadataExceptions\Mapping
* @throws MetadataExceptions\MalformedInput
* @throws ToolsExceptions\InvalidArgument
* @throws ToolsExceptions\InvalidState
* @throws TypeError
* @throws ValueError
*/
Expand All @@ -230,15 +232,16 @@ private function handleCommunication(): void
}

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws ApplicationExceptions\Mapping
* @throws ApplicationExceptions\MalformedInput
* @throws DevicesExceptions\InvalidArgument
* @throws DevicesExceptions\InvalidState
* @throws Exceptions\InvalidArgument
* @throws Exceptions\Runtime
* @throws MetadataExceptions\InvalidArgument
* @throws MetadataExceptions\InvalidState
* @throws MetadataExceptions\Mapping
* @throws MetadataExceptions\MalformedInput
* @throws ToolsExceptions\InvalidArgument
* @throws ToolsExceptions\InvalidState
* @throws TypeError
* @throws ValueError
*/
Expand Down Expand Up @@ -288,7 +291,7 @@ private function processDevice(Documents\Devices\Device $device): bool
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'connector' => [
'id' => $this->connector->getId()->toString(),
],
Expand Down Expand Up @@ -316,7 +319,7 @@ private function processDevice(Documents\Devices\Device $device): bool
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'connector' => [
'id' => $this->connector->getId()->toString(),
],
Expand Down Expand Up @@ -350,7 +353,7 @@ private function processDevice(Documents\Devices\Device $device): bool
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'connector' => [
'id' => $this->connector->getId()->toString(),
],
Expand Down Expand Up @@ -444,7 +447,7 @@ private function processDevice(Documents\Devices\Device $device): bool
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'connector' => [
'id' => $this->connector->getId()->toString(),
],
Expand All @@ -461,7 +464,7 @@ private function processDevice(Documents\Devices\Device $device): bool
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'connector' => [
'id' => $this->connector->getId()->toString(),
],
Expand Down Expand Up @@ -495,7 +498,7 @@ private function processDevice(Documents\Devices\Device $device): bool
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'connector' => [
'id' => $this->connector->getId()->toString(),
],
Expand Down Expand Up @@ -538,7 +541,7 @@ private function processDevice(Documents\Devices\Device $device): bool
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'connector' => [
'id' => $this->connector->getId()->toString(),
],
Expand Down Expand Up @@ -580,8 +583,8 @@ private function processDevice(Documents\Devices\Device $device): bool
/**
* @throws DevicesExceptions\InvalidState
* @throws Exceptions\InvalidArgument
* @throws MetadataExceptions\InvalidArgument
* @throws MetadataExceptions\InvalidState
* @throws ToolsExceptions\InvalidArgument
* @throws ToolsExceptions\InvalidState
* @throws TypeError
* @throws ValueError
*/
Expand Down Expand Up @@ -619,7 +622,7 @@ private function createDeviceClient(Documents\Devices\Device $device): void
[
'source' => MetadataTypes\Sources\Connector::VIERA->value,
'type' => 'television-client',
'exception' => ApplicationHelpers\Logger::buildException($ex),
'exception' => ToolsHelpers\Logger::buildException($ex),
'connector' => [
'id' => $this->connector->getId()->toString(),
],
Expand Down Expand Up @@ -655,15 +658,16 @@ private function getDeviceClient(Documents\Devices\Device $device): API\Televisi
}

/**
* @throws ApplicationExceptions\InvalidArgument
* @throws ApplicationExceptions\InvalidState
* @throws ApplicationExceptions\Mapping
* @throws ApplicationExceptions\MalformedInput
* @throws DevicesExceptions\InvalidArgument
* @throws DevicesExceptions\InvalidState
* @throws Exceptions\InvalidArgument
* @throws Exceptions\Runtime
* @throws MetadataExceptions\InvalidArgument
* @throws MetadataExceptions\InvalidState
* @throws MetadataExceptions\Mapping
* @throws MetadataExceptions\MalformedInput
* @throws ToolsExceptions\InvalidArgument
* @throws ToolsExceptions\InvalidState
* @throws TypeError
* @throws ValueError
*/
Expand Down
Loading

0 comments on commit 80ff36d

Please sign in to comment.