diff --git a/composer.json b/composer.json index 047cd6e..ce3f926 100644 --- a/composer.json +++ b/composer.json @@ -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", diff --git a/src/API/ConnectionManager.php b/src/API/ConnectionManager.php index 851a06a..a010541 100644 --- a/src/API/ConnectionManager.php +++ b/src/API/ConnectionManager.php @@ -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; @@ -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 */ diff --git a/src/API/TelevisionApi.php b/src/API/TelevisionApi.php index bde9634..a6be0fc 100644 --- a/src/API/TelevisionApi.php +++ b/src/API/TelevisionApi.php @@ -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; @@ -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, ], @@ -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, ], @@ -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, ], diff --git a/src/Clients/Discovery.php b/src/Clients/Discovery.php index 5a53442..1a2204f 100644 --- a/src/Clients/Discovery.php +++ b/src/Clients/Discovery.php @@ -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; @@ -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), ], ); @@ -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), ], ); } @@ -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, @@ -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), ], ); @@ -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, @@ -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), ], ); diff --git a/src/Clients/Television.php b/src/Clients/Television.php index 89ed3d6..81aa809 100644 --- a/src/Clients/Television.php +++ b/src/Clients/Television.php @@ -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; @@ -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 */ @@ -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 */ @@ -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 */ @@ -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(), ], @@ -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(), ], @@ -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(), ], @@ -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(), ], @@ -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(), ], @@ -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(), ], @@ -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(), ], @@ -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 */ @@ -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(), ], @@ -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 */ diff --git a/src/Commands/Discover.php b/src/Commands/Discover.php index 0f2f6f4..50837f1 100644 --- a/src/Commands/Discover.php +++ b/src/Commands/Discover.php @@ -26,10 +26,10 @@ use FastyBird\Connector\Viera\Helpers; use FastyBird\Connector\Viera\Queries; 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\Exceptions as ApplicationExceptions; -use FastyBird\Library\Application\Helpers as ApplicationHelpers; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Commands as DevicesCommands; use FastyBird\Module\Devices\Entities as DevicesEntities; @@ -112,6 +112,7 @@ protected function configure(): void } /** + * @throws ApplicationExceptions\InvalidArgument * @throws ApplicationExceptions\InvalidState * @throws ApplicationExceptions\Runtime * @throws Console\Exception\ExceptionInterface @@ -120,8 +121,9 @@ protected function configure(): void * @throws DBAL\Exception * @throws DBAL\Exception\UniqueConstraintViolationException * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -334,14 +336,13 @@ function (string|int|null $answer) use ($connectors): Documents\Connectors\Conne } /** - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DevicesExceptions\InvalidState * @throws DBAL\Exception * @throws DBAL\Exception\UniqueConstraintViolationException * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -429,13 +430,12 @@ private function showResults( /** * @param array $encryptedDevices * - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws DBAL\Exception\UniqueConstraintViolationException * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -499,7 +499,7 @@ private function processEncryptedDevices( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'discovery-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -521,7 +521,7 @@ private function processEncryptedDevices( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'discovery-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -565,7 +565,7 @@ private function processEncryptedDevices( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'discovery-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -583,7 +583,7 @@ private function processEncryptedDevices( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'discovery-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); diff --git a/src/Commands/Execute.php b/src/Commands/Execute.php index 510b842..7191e4f 100644 --- a/src/Commands/Execute.php +++ b/src/Commands/Execute.php @@ -18,7 +18,7 @@ use FastyBird\Connector\Viera\Documents; use FastyBird\Connector\Viera\Exceptions; use FastyBird\Connector\Viera\Queries; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; use FastyBird\Module\Devices\Commands as DevicesCommands; use FastyBird\Module\Devices\Exceptions as DevicesExceptions; use FastyBird\Module\Devices\Models as DevicesModels; @@ -82,10 +82,10 @@ protected function configure(): void } /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState * @throws Console\Exception\ExceptionInterface * @throws DevicesExceptions\InvalidState - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState */ protected function execute(Input\InputInterface $input, Output\OutputInterface $output): int { diff --git a/src/Commands/Install.php b/src/Commands/Install.php index afb23ef..4411603 100644 --- a/src/Commands/Install.php +++ b/src/Commands/Install.php @@ -25,10 +25,10 @@ use FastyBird\Connector\Viera\Helpers; use FastyBird\Connector\Viera\Queries; 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\Exceptions as ApplicationExceptions; -use FastyBird\Library\Application\Helpers as ApplicationHelpers; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Commands as DevicesCommands; use FastyBird\Module\Devices\Entities as DevicesEntities; @@ -99,7 +99,7 @@ public function __construct( private readonly DevicesModels\Entities\Channels\ChannelsRepository $channelsRepository, private readonly DevicesModels\Entities\Channels\ChannelsManager $channelsManager, private readonly DevicesModels\Entities\Channels\Properties\PropertiesRepository $channelsPropertiesRepository, - private readonly ApplicationHelpers\Database $databaseHelper, + private readonly ToolsHelpers\Database $databaseHelper, private readonly DateTimeFactory\Clock $clock, private readonly Localization\Translator $translator, string|null $name = null, @@ -119,6 +119,7 @@ protected function configure(): void } /** + * @throws ApplicationExceptions\InvalidArgument * @throws ApplicationExceptions\InvalidState * @throws Console\Exception\ExceptionInterface * @throws DBAL\Exception @@ -128,8 +129,8 @@ protected function configure(): void * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument * @throws TypeError * @throws ValueError */ @@ -151,8 +152,8 @@ protected function execute(Input\InputInterface $input, Output\OutputInterface $ /** * @throws DevicesExceptions\InvalidState - * @throws MetadataExceptions\InvalidArgument * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument * @throws TypeError * @throws ValueError */ @@ -243,7 +244,7 @@ private function createConnector(Style\SymfonyStyle $io): void [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -275,6 +276,7 @@ private function createConnector(Style\SymfonyStyle $io): void } /** + * @throws ApplicationExceptions\InvalidArgument * @throws Console\Exception\ExceptionInterface * @throws DBAL\Exception * @throws DevicesExceptions\InvalidState @@ -282,8 +284,9 @@ private function createConnector(Style\SymfonyStyle $io): void * @throws DoctrineCrudExceptions\InvalidState * @throws Exceptions\InvalidArgument * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -358,7 +361,7 @@ private function editConnector(Style\SymfonyStyle $io): void [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -392,8 +395,8 @@ private function editConnector(Style\SymfonyStyle $io): void } /** - * @throws ApplicationExceptions\InvalidState * @throws DevicesExceptions\InvalidState + * @throws ToolsExceptions\InvalidState */ private function deleteConnector(Style\SymfonyStyle $io): void { @@ -445,7 +448,7 @@ private function deleteConnector(Style\SymfonyStyle $io): void [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -458,6 +461,7 @@ private function deleteConnector(Style\SymfonyStyle $io): void } /** + * @throws ApplicationExceptions\InvalidArgument * @throws ApplicationExceptions\InvalidState * @throws Console\Exception\ExceptionInterface * @throws DBAL\Exception @@ -467,8 +471,8 @@ private function deleteConnector(Style\SymfonyStyle $io): void * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument * @throws TypeError * @throws ValueError */ @@ -529,10 +533,11 @@ private function listConnectors(Style\SymfonyStyle $io): void } /** + * @throws ApplicationExceptions\InvalidState * @throws DevicesExceptions\InvalidState - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -559,7 +564,7 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -578,7 +583,7 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -610,7 +615,7 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -627,7 +632,7 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), 'request' => [ 'method' => $ex->getRequest()?->getMethod(), 'url' => $ex->getRequest() !== null ? strval($ex->getRequest()->getUri()) : null, @@ -658,7 +663,7 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -714,7 +719,7 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -736,7 +741,7 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1022,7 +1027,7 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1037,11 +1042,12 @@ private function createDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec } /** + * @throws ApplicationExceptions\InvalidState * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -1233,7 +1239,7 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1252,7 +1258,7 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1284,7 +1290,7 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1301,7 +1307,7 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), 'request' => [ 'method' => $ex->getRequest()?->getMethod(), 'url' => $ex->getRequest() !== null ? strval($ex->getRequest()->getUri()) : null, @@ -1330,7 +1336,7 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1393,7 +1399,7 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1416,7 +1422,7 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1566,7 +1572,7 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1581,8 +1587,8 @@ private function editDevice(Style\SymfonyStyle $io, Entities\Connectors\Connecto } /** - * @throws ApplicationExceptions\InvalidState * @throws DevicesExceptions\InvalidState + * @throws ToolsExceptions\InvalidState */ private function deleteDevice(Style\SymfonyStyle $io, Entities\Connectors\Connector $connector): void { @@ -1634,7 +1640,7 @@ private function deleteDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -1648,8 +1654,8 @@ private function deleteDevice(Style\SymfonyStyle $io, Entities\Connectors\Connec /** * @throws DevicesExceptions\InvalidState - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -1691,6 +1697,7 @@ private function listDevices(Style\SymfonyStyle $io, Entities\Connectors\Connect } /** + * @throws ApplicationExceptions\InvalidArgument * @throws ApplicationExceptions\InvalidState * @throws ApplicationExceptions\Runtime * @throws Console\Exception\ExceptionInterface @@ -1702,8 +1709,9 @@ private function listDevices(Style\SymfonyStyle $io, Entities\Connectors\Connect * @throws DoctrineCrudExceptions\InvalidState * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidState - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -1818,6 +1826,7 @@ private function discoverDevices(Style\SymfonyStyle $io, Entities\Connectors\Con } /** + * @throws ApplicationExceptions\InvalidArgument * @throws ApplicationExceptions\InvalidState * @throws Console\Exception\ExceptionInterface * @throws DBAL\Exception @@ -1827,8 +1836,8 @@ private function discoverDevices(Style\SymfonyStyle $io, Entities\Connectors\Con * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument * @throws TypeError * @throws ValueError */ @@ -1906,6 +1915,7 @@ private function askInstallAction(Style\SymfonyStyle $io): void } /** + * @throws ApplicationExceptions\InvalidArgument * @throws ApplicationExceptions\InvalidState * @throws ApplicationExceptions\Runtime * @throws Console\Exception\ExceptionInterface @@ -1916,9 +1926,9 @@ private function askInstallAction(Style\SymfonyStyle $io): void * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -2026,8 +2036,8 @@ private function askDeviceName(Style\SymfonyStyle $io, Entities\Devices\Device|n } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -2056,8 +2066,8 @@ private function askDeviceIpAddress(Style\SymfonyStyle $io, Entities\Devices\Dev } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -2086,8 +2096,8 @@ private function askDevicePort(Style\SymfonyStyle $io, Entities\Devices\Device|n } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -2386,13 +2396,12 @@ function (string|int|null $answer) use ($connector, $devices): Entities\Devices\ /** * @param array $encryptedDevices * - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws DBAL\Exception\UniqueConstraintViolationException * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -2453,7 +2462,7 @@ private function processEncryptedDevices( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -2475,7 +2484,7 @@ private function processEncryptedDevices( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -2529,7 +2538,7 @@ private function processEncryptedDevices( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'install-cmd', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); diff --git a/src/Connector/Connector.php b/src/Connector/Connector.php index 14243cd..9d849e9 100644 --- a/src/Connector/Connector.php +++ b/src/Connector/Connector.php @@ -21,10 +21,10 @@ use FastyBird\Connector\Viera\Exceptions; use FastyBird\Connector\Viera\Queue; use FastyBird\Connector\Viera\Writers; -use FastyBird\Library\Exchange\Exceptions as ExchangeExceptions; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Exchange\Exceptions as ExchangeExceptions; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; use FastyBird\Library\Metadata\Types as MetadataTypes; -use FastyBird\Library\Tools\Exceptions as ToolsExceptions; use FastyBird\Module\Devices\Connectors as DevicesConnectors; use FastyBird\Module\Devices\Documents as DevicesDocuments; use FastyBird\Module\Devices\Exceptions as DevicesExceptions; @@ -76,13 +76,13 @@ public function __construct( /** * @return Promise\PromiseInterface * + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState + * @throws ApplicationExceptions\MalformedInput * @throws DevicesExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState * @throws Exceptions\Runtime * @throws ExchangeExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState - * @throws MetadataExceptions\MalformedInput * @throws ToolsExceptions\InvalidArgument */ public function execute(bool $standalone = true): Promise\PromiseInterface diff --git a/src/DI/VieraExtension.php b/src/DI/VieraExtension.php index bbcb82e..72de555 100644 --- a/src/DI/VieraExtension.php +++ b/src/DI/VieraExtension.php @@ -30,10 +30,10 @@ use FastyBird\Connector\Viera\Services; use FastyBird\Connector\Viera\Subscribers; use FastyBird\Connector\Viera\Writers; -use FastyBird\Library\Application\Boot as ApplicationBoot; -use FastyBird\Library\Exchange\DI as ExchangeDI; -use FastyBird\Library\Metadata; -use FastyBird\Library\Metadata\Documents as MetadataDocuments; +use FastyBird\Core\Application\Boot as ApplicationBoot; +use FastyBird\Core\Application\DI as ApplicationDI; +use FastyBird\Core\Application\Documents as ApplicationDocuments; +use FastyBird\Core\Exchange\DI as ExchangeDI; use FastyBird\Module\Devices\DI as DevicesDI; use Nette\Bootstrap; use Nette\DI; @@ -355,7 +355,7 @@ public function beforeCompile(): void * APPLICATION DOCUMENTS */ - $services = $builder->findByTag(Metadata\DI\MetadataExtension::DRIVER_TAG); + $services = $builder->findByTag(ApplicationDI\ApplicationExtension::DRIVER_TAG); if ($services !== []) { $services = array_keys($services); @@ -370,7 +370,7 @@ public function beforeCompile(): void ); $documentAttributeDriverChainService = $builder->getDefinitionByType( - MetadataDocuments\Mapping\Driver\MappingDriverChain::class, + ApplicationDocuments\Mapping\Driver\MappingDriverChain::class, ); if ($documentAttributeDriverChainService instanceof DI\Definitions\ServiceDefinition) { diff --git a/src/Documents/Channels/Channel.php b/src/Documents/Channels/Channel.php index 6e2404d..7ec7177 100644 --- a/src/Documents/Channels/Channel.php +++ b/src/Documents/Channels/Channel.php @@ -16,11 +16,11 @@ namespace FastyBird\Connector\Viera\Documents\Channels; use FastyBird\Connector\Viera\Entities; -use FastyBird\Library\Metadata\Documents\Mapping as DOC; +use FastyBird\Core\Application\Documents as ApplicationDocuments; use FastyBird\Module\Devices\Documents as DevicesDocuments; -#[DOC\Document(entity: Entities\Channels\Channel::class)] -#[DOC\DiscriminatorEntry(name: Entities\Channels\Channel::TYPE)] +#[ApplicationDocuments\Mapping\Document(entity: Entities\Channels\Channel::class)] +#[ApplicationDocuments\Mapping\DiscriminatorEntry(name: Entities\Channels\Channel::TYPE)] class Channel extends DevicesDocuments\Channels\Channel { diff --git a/src/Documents/Connectors/Connector.php b/src/Documents/Connectors/Connector.php index 2cafab8..1fc551e 100644 --- a/src/Documents/Connectors/Connector.php +++ b/src/Documents/Connectors/Connector.php @@ -16,11 +16,11 @@ namespace FastyBird\Connector\Viera\Documents\Connectors; use FastyBird\Connector\Viera\Entities; -use FastyBird\Library\Metadata\Documents\Mapping as DOC; +use FastyBird\Core\Application\Documents as ApplicationDocuments; use FastyBird\Module\Devices\Documents as DevicesDocuments; -#[DOC\Document(entity: Entities\Connectors\Connector::class)] -#[DOC\DiscriminatorEntry(name: Entities\Connectors\Connector::TYPE)] +#[ApplicationDocuments\Mapping\Document(entity: Entities\Connectors\Connector::class)] +#[ApplicationDocuments\Mapping\DiscriminatorEntry(name: Entities\Connectors\Connector::TYPE)] class Connector extends DevicesDocuments\Connectors\Connector { diff --git a/src/Documents/Devices/Device.php b/src/Documents/Devices/Device.php index 9c79291..51451b3 100644 --- a/src/Documents/Devices/Device.php +++ b/src/Documents/Devices/Device.php @@ -16,11 +16,11 @@ namespace FastyBird\Connector\Viera\Documents\Devices; use FastyBird\Connector\Viera\Entities; -use FastyBird\Library\Metadata\Documents\Mapping as DOC; +use FastyBird\Core\Application\Documents as ApplicationDocuments; use FastyBird\Module\Devices\Documents as DevicesDocuments; -#[DOC\Document(entity: Entities\Devices\Device::class)] -#[DOC\DiscriminatorEntry(name: Entities\Devices\Device::TYPE)] +#[ApplicationDocuments\Mapping\Document(entity: Entities\Devices\Device::class)] +#[ApplicationDocuments\Mapping\DiscriminatorEntry(name: Entities\Devices\Device::TYPE)] class Device extends DevicesDocuments\Devices\Device { diff --git a/src/Entities/Channels/Channel.php b/src/Entities/Channels/Channel.php index 77faae9..3a1a770 100644 --- a/src/Entities/Channels/Channel.php +++ b/src/Entities/Channels/Channel.php @@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM; use FastyBird\Connector\Viera\Entities; -use FastyBird\Library\Application\Entities\Mapping as ApplicationMapping; +use FastyBird\Core\Application\Entities\Mapping as ApplicationMapping; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; use Ramsey\Uuid; diff --git a/src/Entities/Connectors/Connector.php b/src/Entities/Connectors/Connector.php index ffc15c5..3939efd 100644 --- a/src/Entities/Connectors/Connector.php +++ b/src/Entities/Connectors/Connector.php @@ -18,7 +18,7 @@ use Doctrine\ORM\Mapping as ORM; use FastyBird\Connector\Viera\Entities; use FastyBird\Connector\Viera\Exceptions; -use FastyBird\Library\Application\Entities\Mapping as ApplicationMapping; +use FastyBird\Core\Application\Entities\Mapping as ApplicationMapping; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; diff --git a/src/Entities/Devices/Device.php b/src/Entities/Devices/Device.php index fdc4e5f..232e89f 100644 --- a/src/Entities/Devices/Device.php +++ b/src/Entities/Devices/Device.php @@ -19,8 +19,8 @@ use FastyBird\Connector\Viera\Entities; use FastyBird\Connector\Viera\Exceptions; use FastyBird\Connector\Viera\Types; -use FastyBird\Library\Application\Entities\Mapping as ApplicationMapping; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; +use FastyBird\Core\Application\Entities\Mapping as ApplicationMapping; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; use Ramsey\Uuid; @@ -100,8 +100,8 @@ public function addChannel(DevicesEntities\Channels\Channel $channel): void } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -125,8 +125,8 @@ public function getIpAddress(): string|null } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -150,8 +150,8 @@ public function getPort(): int } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -179,8 +179,8 @@ public function isEncrypted(): bool } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -204,8 +204,8 @@ public function getAppId(): string|null } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -229,8 +229,8 @@ public function getEncryptionKey(): string|null } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -254,8 +254,8 @@ public function getModel(): string|null } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -279,8 +279,8 @@ public function getManufacturer(): string|null } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -304,8 +304,8 @@ public function getMacAddress(): string|null } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -329,8 +329,8 @@ public function getSerialNumber(): string|null } /** - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ diff --git a/src/Helpers/ChannelProperty.php b/src/Helpers/ChannelProperty.php index 70913bf..bdbc66d 100644 --- a/src/Helpers/ChannelProperty.php +++ b/src/Helpers/ChannelProperty.php @@ -20,8 +20,8 @@ use FastyBird\Connector\Viera\Exceptions; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Types; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; -use FastyBird\Library\Application\Helpers as ApplicationHelpers; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; +use FastyBird\Core\Tools\Helpers as ToolsHelpers; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; use FastyBird\Module\Devices\Models as DevicesModels; @@ -36,7 +36,7 @@ public function __construct( private DevicesModels\Entities\Channels\ChannelsRepository $channelsRepository, private DevicesModels\Entities\Channels\Properties\PropertiesRepository $channelsPropertiesRepository, private DevicesModels\Entities\Channels\Properties\PropertiesManager $channelsPropertiesManager, - private ApplicationHelpers\Database $databaseHelper, + private ToolsHelpers\Database $databaseHelper, private Viera\Logger $logger, ) { @@ -46,10 +46,10 @@ public function __construct( * @param class-string $type * @param string|array|array|Utils\ArrayHash|null>|array|Utils\ArrayHash|null>>|null $format * - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws Exceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime */ public function create( string $type, diff --git a/src/Helpers/Device.php b/src/Helpers/Device.php index a431631..3469be9 100644 --- a/src/Helpers/Device.php +++ b/src/Helpers/Device.php @@ -20,7 +20,7 @@ use FastyBird\Connector\Viera\Exceptions; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Types; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; +use FastyBird\Core\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; @@ -53,8 +53,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 */ @@ -82,8 +82,8 @@ public function getIpAddress(Documents\Devices\Device $device): string|null /** * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -111,8 +111,8 @@ public function getPort(Documents\Devices\Device $device): int /** * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -140,8 +140,8 @@ public function isEncrypted(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 */ @@ -169,8 +169,8 @@ public function getAppId(Documents\Devices\Device $device): string|null /** * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -198,8 +198,8 @@ public function getEncryptionKey(Documents\Devices\Device $device): string|null /** * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -227,8 +227,8 @@ public function getModel(Documents\Devices\Device $device): string|null /** * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -256,8 +256,8 @@ public function getManufacturer(Documents\Devices\Device $device): string|null /** * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -285,8 +285,8 @@ public function getMacAddress(Documents\Devices\Device $device): string|null /** * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -314,8 +314,8 @@ public function getSerialNumber(Documents\Devices\Device $device): string|null /** * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ diff --git a/src/Helpers/DeviceProperty.php b/src/Helpers/DeviceProperty.php index 628a761..5005928 100644 --- a/src/Helpers/DeviceProperty.php +++ b/src/Helpers/DeviceProperty.php @@ -21,8 +21,8 @@ use FastyBird\Connector\Viera\Exceptions; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Types; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; -use FastyBird\Library\Application\Helpers as ApplicationHelpers; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; +use FastyBird\Core\Tools\Helpers as ToolsHelpers; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; use FastyBird\Module\Devices\Models as DevicesModels; @@ -37,7 +37,7 @@ public function __construct( private DevicesModels\Entities\Devices\DevicesRepository $devicesRepository, private DevicesModels\Entities\Devices\Properties\PropertiesRepository $devicesPropertiesRepository, private DevicesModels\Entities\Devices\Properties\PropertiesManager $devicesPropertiesManager, - private ApplicationHelpers\Database $databaseHelper, + private ToolsHelpers\Database $databaseHelper, private Viera\Logger $logger, ) { @@ -47,10 +47,10 @@ public function __construct( * @param class-string $type * @param string|array|array|Utils\ArrayHash|null>|array|Utils\ArrayHash|null>>|null $format * - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws Exceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime */ public function create( string $type, diff --git a/src/Hydrators/Channels/Channel.php b/src/Hydrators/Channels/Channel.php index ace1cdb..1529a15 100644 --- a/src/Hydrators/Channels/Channel.php +++ b/src/Hydrators/Channels/Channel.php @@ -18,9 +18,9 @@ use Doctrine\Persistence; use FastyBird\Connector\Viera\Entities; use FastyBird\Connector\Viera\Schemas; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; use FastyBird\JsonApi\Exceptions as JsonApiExceptions; use FastyBird\JsonApi\Helpers; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; use FastyBird\Module\Devices\Hydrators as DevicesHydrators; use FastyBird\Module\Devices\Models as DevicesModels; use Fig\Http\Message\StatusCodeInterface; @@ -58,8 +58,8 @@ public function getEntityName(): string } /** - * @throws ApplicationExceptions\InvalidState * @throws JsonApiExceptions\JsonApiError + * @throws ToolsExceptions\InvalidState */ protected function hydrateDeviceRelationship( JsonAPIDocument\Objects\IRelationshipObject $relationship, diff --git a/src/Hydrators/Devices/Device.php b/src/Hydrators/Devices/Device.php index 220f9f5..2339a4e 100644 --- a/src/Hydrators/Devices/Device.php +++ b/src/Hydrators/Devices/Device.php @@ -18,9 +18,9 @@ use Doctrine\Persistence; use FastyBird\Connector\Viera\Entities; use FastyBird\Connector\Viera\Schemas; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; use FastyBird\JsonApi\Exceptions as JsonApiExceptions; use FastyBird\JsonApi\Helpers; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; use FastyBird\Module\Devices\Hydrators as DevicesHydrators; use FastyBird\Module\Devices\Models as DevicesModels; use Fig\Http\Message\StatusCodeInterface; @@ -58,8 +58,8 @@ public function getEntityName(): string } /** - * @throws ApplicationExceptions\InvalidState * @throws JsonApiExceptions\JsonApiError + * @throws ToolsExceptions\InvalidState */ protected function hydrateConnectorRelationship( JsonAPIDocument\Objects\IRelationshipObject $relationship, diff --git a/src/Queue/Consumers/StoreChannelPropertyState.php b/src/Queue/Consumers/StoreChannelPropertyState.php index 1573a06..2bed8a2 100644 --- a/src/Queue/Consumers/StoreChannelPropertyState.php +++ b/src/Queue/Consumers/StoreChannelPropertyState.php @@ -21,9 +21,9 @@ use FastyBird\Connector\Viera\Exceptions; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Queue; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; 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; @@ -61,12 +61,13 @@ public function __construct( } /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState * @throws DevicesExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState * @throws TypeError * @throws ValueError */ diff --git a/src/Queue/Consumers/StoreDevice.php b/src/Queue/Consumers/StoreDevice.php index 29b45dc..32624ae 100644 --- a/src/Queue/Consumers/StoreDevice.php +++ b/src/Queue/Consumers/StoreDevice.php @@ -23,8 +23,8 @@ use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Queue; use FastyBird\Connector\Viera\Types; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; -use FastyBird\Library\Application\Helpers as ApplicationHelpers; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; +use FastyBird\Core\Tools\Helpers as ToolsHelpers; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; use FastyBird\Module\Devices\Models as DevicesModels; @@ -57,16 +57,16 @@ public function __construct( private readonly DevicesModels\Entities\Devices\DevicesManager $devicesManager, private readonly DevicesModels\Entities\Channels\ChannelsRepository $channelsRepository, private readonly DevicesModels\Entities\Channels\ChannelsManager $channelsManager, - private readonly ApplicationHelpers\Database $databaseHelper, + private readonly ToolsHelpers\Database $databaseHelper, ) { } /** - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws Exceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime */ public function consume(Queue\Messages\Message $message): bool { diff --git a/src/Queue/Consumers/StoreDeviceConnectionState.php b/src/Queue/Consumers/StoreDeviceConnectionState.php index dbe2e13..b303817 100644 --- a/src/Queue/Consumers/StoreDeviceConnectionState.php +++ b/src/Queue/Consumers/StoreDeviceConnectionState.php @@ -20,10 +20,9 @@ use FastyBird\Connector\Viera\Documents; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Queue; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; 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; @@ -62,16 +61,17 @@ public function __construct( } /** + * @throws ApplicationExceptions\InvalidArgument * @throws ApplicationExceptions\InvalidState + * @throws ApplicationExceptions\Mapping + * @throws ApplicationExceptions\MalformedInput * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws DevicesExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState - * @throws MetadataExceptions\Mapping - * @throws MetadataExceptions\MalformedInput * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ diff --git a/src/Queue/Consumers/WriteChannelPropertyState.php b/src/Queue/Consumers/WriteChannelPropertyState.php index 87758f1..da9b46c 100644 --- a/src/Queue/Consumers/WriteChannelPropertyState.php +++ b/src/Queue/Consumers/WriteChannelPropertyState.php @@ -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\Helpers as ToolsHelpers; +use FastyBird\Core\Tools\Utilities as ToolsUtilities; 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\Metadata\Utilities as MetadataUtilities; use FastyBird\Module\Devices\Documents as DevicesDocuments; use FastyBird\Module\Devices\Exceptions as DevicesExceptions; use FastyBird\Module\Devices\Models as DevicesModels; @@ -80,12 +80,12 @@ public function __construct( } /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState * @throws DevicesExceptions\InvalidState * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState * @throws RuntimeException * @throws Throwable * @throws TypeError @@ -299,7 +299,7 @@ public function consume(Queue\Messages\Message $message): bool return true; } - $expectedValue = MetadataUtilities\Value::flattenValue( + $expectedValue = ToolsUtilities\Value::flattenValue( $state->getExpectedValue(), ); @@ -469,7 +469,7 @@ public function consume(Queue\Messages\Message $message): bool [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'write-channel-property-state-message-consumer', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), 'connector' => [ 'id' => $connector->getId()->toString(), ], @@ -510,7 +510,7 @@ public function consume(Queue\Messages\Message $message): bool [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'write-channel-property-state-message-consumer', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), 'connector' => [ 'id' => $connector->getId()->toString(), ], @@ -551,7 +551,7 @@ public function consume(Queue\Messages\Message $message): bool [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'write-channel-property-state-message-consumer', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), 'connector' => [ 'id' => $connector->getId()->toString(), ], @@ -658,7 +658,7 @@ public function consume(Queue\Messages\Message $message): bool Utils\ArrayHash::from([ DevicesStates\Property::ACTUAL_VALUE_FIELD => intval( - MetadataUtilities\Value::toString($expectedValue, true), + ToolsUtilities\Value::toString($expectedValue, true), ) > Viera\Constants::MIN_APPLICATION_CODE ? $expectedValue : null, @@ -682,7 +682,7 @@ public function consume(Queue\Messages\Message $message): bool Utils\ArrayHash::from([ DevicesStates\Property::ACTUAL_VALUE_FIELD => intval( - MetadataUtilities\Value::toString($expectedValue, true), + ToolsUtilities\Value::toString($expectedValue, true), ) < Viera\Constants::MAX_HDMI_CODE ? $expectedValue : null, diff --git a/src/Queue/Messages/Device.php b/src/Queue/Messages/Device.php index 2792f0e..8b21e9a 100644 --- a/src/Queue/Messages/Device.php +++ b/src/Queue/Messages/Device.php @@ -15,7 +15,7 @@ namespace FastyBird\Connector\Viera\Queue\Messages; -use FastyBird\Library\Application\ObjectMapper as ApplicationObjectMapper; +use FastyBird\Core\Application\ObjectMapper as ApplicationObjectMapper; use Ramsey\Uuid; /** diff --git a/src/Queue/Messages/State.php b/src/Queue/Messages/State.php index 65b36aa..a568006 100644 --- a/src/Queue/Messages/State.php +++ b/src/Queue/Messages/State.php @@ -16,8 +16,8 @@ namespace FastyBird\Connector\Viera\Queue\Messages; use DateTimeInterface; +use FastyBird\Core\Tools\Utilities as ToolsUtilities; use FastyBird\Library\Metadata\Types as MetadataTypes; -use FastyBird\Library\Metadata\Utilities as MetadataUtilities; use FastyBird\Module\Devices\States as DevicesStates; use Orisai\ObjectMapper; use Ramsey\Uuid; @@ -111,10 +111,10 @@ public function isValid(): bool public function toArray(): array { return [ - DevicesStates\Property::ACTUAL_VALUE_FIELD => MetadataUtilities\Value::flattenValue( + DevicesStates\Property::ACTUAL_VALUE_FIELD => ToolsUtilities\Value::flattenValue( $this->getActualValue(), ), - DevicesStates\Property::EXPECTED_VALUE_FIELD => MetadataUtilities\Value::flattenValue( + DevicesStates\Property::EXPECTED_VALUE_FIELD => ToolsUtilities\Value::flattenValue( $this->getExpectedValue(), ), DevicesStates\Property::PENDING_FIELD => $this->getPending() instanceof DateTimeInterface diff --git a/src/Queue/Messages/StoreChannelPropertyState.php b/src/Queue/Messages/StoreChannelPropertyState.php index c19769c..f000097 100644 --- a/src/Queue/Messages/StoreChannelPropertyState.php +++ b/src/Queue/Messages/StoreChannelPropertyState.php @@ -16,7 +16,7 @@ namespace FastyBird\Connector\Viera\Queue\Messages; use FastyBird\Connector\Viera\Types; -use FastyBird\Library\Application\ObjectMapper as ApplicationObjectMapper; +use FastyBird\Core\Application\ObjectMapper as ApplicationObjectMapper; use Orisai\ObjectMapper; use Ramsey\Uuid; use function array_merge; diff --git a/src/Queue/Messages/StoreDevice.php b/src/Queue/Messages/StoreDevice.php index 1762f7e..638d61f 100644 --- a/src/Queue/Messages/StoreDevice.php +++ b/src/Queue/Messages/StoreDevice.php @@ -15,7 +15,7 @@ namespace FastyBird\Connector\Viera\Queue\Messages; -use FastyBird\Library\Application\ObjectMapper as ApplicationObjectMapper; +use FastyBird\Core\Application\ObjectMapper as ApplicationObjectMapper; use Orisai\ObjectMapper; use Ramsey\Uuid; use function array_map; diff --git a/src/Queue/Messages/WriteChannelPropertyState.php b/src/Queue/Messages/WriteChannelPropertyState.php index f9687a6..b204bcb 100644 --- a/src/Queue/Messages/WriteChannelPropertyState.php +++ b/src/Queue/Messages/WriteChannelPropertyState.php @@ -15,7 +15,7 @@ namespace FastyBird\Connector\Viera\Queue\Messages; -use FastyBird\Library\Application\ObjectMapper as ApplicationObjectMapper; +use FastyBird\Core\Application\ObjectMapper as ApplicationObjectMapper; use Orisai\ObjectMapper; use Ramsey\Uuid; diff --git a/src/Subscribers/Controls.php b/src/Subscribers/Controls.php index 4da1f50..03054a6 100644 --- a/src/Subscribers/Controls.php +++ b/src/Subscribers/Controls.php @@ -20,7 +20,7 @@ use Doctrine\ORM; use Doctrine\Persistence; use FastyBird\Connector\Viera\Entities; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; use FastyBird\Module\Devices\Models as DevicesModels; use FastyBird\Module\Devices\Queries as DevicesQueries; use FastyBird\Module\Devices\Types as DevicesTypes; @@ -58,11 +58,11 @@ public function getSubscribedEvents(): array /** * @param Persistence\Event\LifecycleEventArgs $eventArgs * - * @throws ApplicationExceptions\InvalidState * @throws DBAL\Exception\UniqueConstraintViolationException * @throws DoctrineCrudExceptions\EntityCreation * @throws DoctrineCrudExceptions\InvalidArgument * @throws DoctrineCrudExceptions\InvalidState + * @throws ToolsExceptions\InvalidState */ public function postPersist(Persistence\Event\LifecycleEventArgs $eventArgs): void { diff --git a/src/Subscribers/Device.php b/src/Subscribers/Device.php index 049a2b3..1e45691 100644 --- a/src/Subscribers/Device.php +++ b/src/Subscribers/Device.php @@ -22,7 +22,7 @@ use FastyBird\Connector\Viera\Helpers; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Types; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; use FastyBird\Module\Devices\Events as DevicesEvents; @@ -62,10 +62,10 @@ public static function getSubscribedEvents(): array } /** - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws Exceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -81,10 +81,10 @@ public function updated(DevicesEvents\EntityUpdated $event): void } /** - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws Exceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ diff --git a/src/Subscribers/Properties.php b/src/Subscribers/Properties.php index 39dc57b..f4ef1a7 100644 --- a/src/Subscribers/Properties.php +++ b/src/Subscribers/Properties.php @@ -25,9 +25,8 @@ use FastyBird\Connector\Viera\Helpers; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Types; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; -use FastyBird\Library\Metadata\Formats as MetadataFormats; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; +use FastyBird\Core\Tools\Formats as ToolsFormats; use FastyBird\Library\Metadata\Types as MetadataTypes; use FastyBird\Module\Devices\Entities as DevicesEntities; use FastyBird\Module\Devices\Models as DevicesModels; @@ -73,14 +72,14 @@ public function getSubscribedEvents(): array /** * @param Persistence\Event\LifecycleEventArgs $eventArgs * - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws DBAL\Exception\UniqueConstraintViolationException * @throws DoctrineCrudExceptions\EntityCreation * @throws DoctrineCrudExceptions\InvalidArgument * @throws DoctrineCrudExceptions\InvalidState * @throws Exceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -106,14 +105,13 @@ public function postPersist(Persistence\Event\LifecycleEventArgs $eventArgs): vo /** * @param Persistence\Event\LifecycleEventArgs $eventArgs * - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws DBAL\Exception\UniqueConstraintViolationException * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -142,12 +140,12 @@ public function postUpdate(Persistence\Event\LifecycleEventArgs $eventArgs): voi } /** - * @throws ApplicationExceptions\InvalidState * @throws DBAL\Exception\UniqueConstraintViolationException * @throws DoctrineCrudExceptions\EntityCreation * @throws DoctrineCrudExceptions\InvalidArgument * @throws DoctrineCrudExceptions\InvalidState * @throws Exceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState */ private function configureDeviceState(Entities\Devices\Device $device): void { @@ -197,11 +195,11 @@ private function configureDeviceState(Entities\Devices\Device $device): void } /** - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws DBAL\Exception\UniqueConstraintViolationException * @throws Exceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -228,13 +226,12 @@ private function configureDeviceKeys(DevicesEntities\Channels\Channel $channel): } /** - * @throws ApplicationExceptions\InvalidState - * @throws ApplicationExceptions\Runtime * @throws DBAL\Exception * @throws DBAL\Exception\UniqueConstraintViolationException * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState + * @throws ToolsExceptions\InvalidArgument + * @throws ToolsExceptions\InvalidState + * @throws ToolsExceptions\Runtime * @throws TypeError * @throws ValueError */ @@ -245,7 +242,7 @@ private function configureDeviceInputSource(DevicesEntities\Channels\Properties\ if ($property->getIdentifier() === Types\ChannelPropertyIdentifier::HDMI->value) { $hdmiFormat = $property->getFormat(); - $hdmiFormat = $hdmiFormat instanceof MetadataFormats\CombinedEnum + $hdmiFormat = $hdmiFormat instanceof ToolsFormats\CombinedEnum ? $hdmiFormat->toArray() : []; } else { @@ -260,7 +257,7 @@ private function configureDeviceInputSource(DevicesEntities\Channels\Properties\ $hdmiFormat = $hdmiProperty?->getFormat(); - $hdmiFormat = $hdmiFormat instanceof MetadataFormats\CombinedEnum + $hdmiFormat = $hdmiFormat instanceof ToolsFormats\CombinedEnum ? $hdmiFormat->toArray() : []; } @@ -268,7 +265,7 @@ private function configureDeviceInputSource(DevicesEntities\Channels\Properties\ if ($property->getIdentifier() === Types\ChannelPropertyIdentifier::APPLICATION->value) { $applicationFormat = $property->getFormat(); - $applicationFormat = $applicationFormat instanceof MetadataFormats\CombinedEnum + $applicationFormat = $applicationFormat instanceof ToolsFormats\CombinedEnum ? $applicationFormat->toArray() : []; } else { @@ -283,7 +280,7 @@ private function configureDeviceInputSource(DevicesEntities\Channels\Properties\ $applicationFormat = $applicationProperty?->getFormat(); - $applicationFormat = $applicationFormat instanceof MetadataFormats\CombinedEnum + $applicationFormat = $applicationFormat instanceof ToolsFormats\CombinedEnum ? $applicationFormat->toArray() : []; } diff --git a/src/Writers/Event.php b/src/Writers/Event.php index fc85b18..36246e3 100644 --- a/src/Writers/Event.php +++ b/src/Writers/Event.php @@ -18,7 +18,7 @@ use FastyBird\Connector\Viera\Documents; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Queue; -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 Symfony\Component\EventDispatcher; @@ -101,7 +101,7 @@ public function stateChanged( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'event-writer', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); } diff --git a/src/Writers/Exchange.php b/src/Writers/Exchange.php index 40cf850..c19e395 100644 --- a/src/Writers/Exchange.php +++ b/src/Writers/Exchange.php @@ -21,14 +21,14 @@ use FastyBird\Connector\Viera\Helpers; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Queue; +use FastyBird\Core\Application\Documents as ApplicationDocuments; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Exchange\Consumers as ExchangeConsumers; +use FastyBird\Core\Exchange\Exceptions as ExchangeExceptions; +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\Exchange\Consumers as ExchangeConsumers; -use FastyBird\Library\Exchange\Exceptions as ExchangeExceptions; -use FastyBird\Library\Metadata\Documents as MetadataDocuments; -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\Constants as DevicesConstants; use FastyBird\Module\Devices\Documents as DevicesDocuments; use FastyBird\Module\Devices\Exceptions as DevicesExceptions; @@ -82,13 +82,13 @@ public function __construct( } /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState + * @throws ApplicationExceptions\MalformedInput * @throws DevicesExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState * @throws Exceptions\Runtime * @throws ExchangeExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState - * @throws MetadataExceptions\MalformedInput * @throws ToolsExceptions\InvalidArgument */ public function connect(): void @@ -111,7 +111,7 @@ public function disconnect(): void public function consume( MetadataTypes\Sources\Source $source, string $routingKey, - MetadataDocuments\Document|null $document, + ApplicationDocuments\Document|null $document, ): void { try { @@ -179,7 +179,7 @@ public function consume( [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'exchange-writer', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); } diff --git a/src/Writers/Periodic.php b/src/Writers/Periodic.php index 43a4f49..a805522 100644 --- a/src/Writers/Periodic.php +++ b/src/Writers/Periodic.php @@ -22,11 +22,11 @@ use FastyBird\Connector\Viera\Helpers; use FastyBird\Connector\Viera\Queries; use FastyBird\Connector\Viera\Queue; +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; @@ -92,12 +92,12 @@ public function __construct( } /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState + * @throws ApplicationExceptions\MalformedInput * @throws DevicesExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState - * @throws MetadataExceptions\MalformedInput * @throws ToolsExceptions\InvalidArgument */ public function connect(): void @@ -162,12 +162,12 @@ public function disconnect(): void } /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState + * @throws ApplicationExceptions\MalformedInput * @throws DevicesExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState - * @throws MetadataExceptions\MalformedInput * @throws ToolsExceptions\InvalidArgument */ private function handleCommunication(): void @@ -190,12 +190,12 @@ private function handleCommunication(): void } /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState + * @throws ApplicationExceptions\MalformedInput * @throws DevicesExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState - * @throws MetadataExceptions\MalformedInput * @throws ToolsExceptions\InvalidArgument */ private function writeProperty(Documents\Devices\Device $device): bool @@ -278,7 +278,7 @@ private function writeProperty(Documents\Devices\Device $device): bool [ 'source' => MetadataTypes\Sources\Connector::VIERA->value, 'type' => 'periodic-writer', - 'exception' => ApplicationHelpers\Logger::buildException($ex), + 'exception' => ToolsHelpers\Logger::buildException($ex), ], ); @@ -291,12 +291,12 @@ private function writeProperty(Documents\Devices\Device $device): bool } /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState + * @throws ApplicationExceptions\MalformedInput * @throws DevicesExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState * @throws Exceptions\Runtime - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState - * @throws MetadataExceptions\MalformedInput * @throws ToolsExceptions\InvalidArgument */ private function registerLoopHandler(): void diff --git a/tests/cases/unit/API/TelevisionApiTest.php b/tests/cases/unit/API/TelevisionApiTest.php index 35e0e5a..e381b83 100644 --- a/tests/cases/unit/API/TelevisionApiTest.php +++ b/tests/cases/unit/API/TelevisionApiTest.php @@ -7,7 +7,7 @@ use FastyBird\Connector\Viera\Exceptions; use FastyBird\Connector\Viera\Services; use FastyBird\Connector\Viera\Tests; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; use Fig\Http\Message\RequestMethodInterface; use GuzzleHttp; use Nette\DI; diff --git a/tests/cases/unit/BaseTestCase.php b/tests/cases/unit/BaseTestCase.php index adeb24d..b84f569 100644 --- a/tests/cases/unit/BaseTestCase.php +++ b/tests/cases/unit/BaseTestCase.php @@ -4,8 +4,8 @@ use Error; use FastyBird\Connector\Viera\DI; -use FastyBird\Library\Application\Boot as ApplicationBoot; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Application\Boot as ApplicationBoot; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; use Nette; use PHPUnit\Framework\TestCase; use function constant; diff --git a/tests/cases/unit/Clients/DiscoveryTest.php b/tests/cases/unit/Clients/DiscoveryTest.php index 786d218..232136f 100644 --- a/tests/cases/unit/Clients/DiscoveryTest.php +++ b/tests/cases/unit/Clients/DiscoveryTest.php @@ -11,8 +11,8 @@ use FastyBird\Connector\Viera\Queue; use FastyBird\Connector\Viera\Services; use FastyBird\Connector\Viera\Tests; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; -use FastyBird\Library\Metadata\Exceptions as MetadataExceptions; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Tools\Exceptions as ToolsExceptions; use FastyBird\Module\Devices\Exceptions as DevicesExceptions; use FastyBird\Module\Devices\Models as DevicesModels; use GuzzleHttp; @@ -34,13 +34,14 @@ final class DiscoveryTest extends Tests\Cases\Unit\DbTestCase { /** + * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState * @throws ApplicationExceptions\InvalidArgument * @throws DevicesExceptions\InvalidState * @throws DI\MissingServiceException * @throws Exceptions\InvalidArgument - * @throws MetadataExceptions\InvalidArgument - * @throws MetadataExceptions\InvalidState * @throws RuntimeException + * @throws ToolsExceptions\InvalidArgument * @throws Error */ public function testDiscover(): void diff --git a/tests/cases/unit/DI/VieraExtensionTest.php b/tests/cases/unit/DI/VieraExtensionTest.php index 6ace4da..336468b 100644 --- a/tests/cases/unit/DI/VieraExtensionTest.php +++ b/tests/cases/unit/DI/VieraExtensionTest.php @@ -15,7 +15,7 @@ use FastyBird\Connector\Viera\Subscribers; use FastyBird\Connector\Viera\Tests; use FastyBird\Connector\Viera\Writers; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; use Nette; final class VieraExtensionTest extends Tests\Cases\Unit\BaseTestCase diff --git a/tests/cases/unit/DbTestCase.php b/tests/cases/unit/DbTestCase.php index 75b7fdb..1064fb7 100644 --- a/tests/cases/unit/DbTestCase.php +++ b/tests/cases/unit/DbTestCase.php @@ -7,8 +7,8 @@ use Error; use FastyBird\Connector\Viera\DI; use FastyBird\Connector\Viera\Exceptions; -use FastyBird\Library\Application\Boot as ApplicationBoot; -use FastyBird\Library\Application\Exceptions as ApplicationExceptions; +use FastyBird\Core\Application\Boot as ApplicationBoot; +use FastyBird\Core\Application\Exceptions as ApplicationExceptions; use IPub\DoctrineCrud; use Nette; use Nettrine\ORM as NettrineORM; diff --git a/tests/common.neon b/tests/common.neon index f633a51..d3584fd 100644 --- a/tests/common.neon +++ b/tests/common.neon @@ -27,8 +27,8 @@ extensions: fbDateTimeFactory : FastyBird\DateTimeFactory\DI\DateTimeFactoryExtension fbJsonApi : FastyBird\JsonApi\DI\JsonApiExtension fbSimpleAuth : FastyBird\SimpleAuth\DI\SimpleAuthExtension - fbMetadataLibrary : FastyBird\Library\Metadata\DI\MetadataExtension - fbExchangeLibrary : FastyBird\Library\Exchange\DI\ExchangeExtension + fbTools : FastyBird\Core\Tools\DI\ToolsExtension + fbExchange : FastyBird\Core\Exchange\DI\ExchangeExtension fbDevicesModule : FastyBird\Module\Devices\DI\DevicesExtension services: @@ -82,10 +82,6 @@ nettrineOrm: nettrineOrmAttributes: mapping: [] -fbMetadataLibrary: - documents: - mapping: [] - fbSimpleAuth: token: issuer: com.fastybird.auth-module @@ -104,4 +100,8 @@ fbJsonApi: copyright: FastyBird s.r.o fbDateTimeFactory: - frozen: DateTimeImmutable('2020-04-01T12:00:00+00:00') \ No newline at end of file + frozen: DateTimeImmutable('2020-04-01T12:00:00+00:00') + +fbApplication: + documents: + mapping: [] \ No newline at end of file