From 88392b5f1681d7d05531dc1238e618722f3756a3 Mon Sep 17 00:00:00 2001 From: GitHub Date: Fri, 24 May 2024 11:44:41 +0000 Subject: [PATCH] Use new element-plus theme (#259) --- src/Clients/Discovery.php | 5 ++++- src/Clients/Television.php | 17 +++++++++++++++++ src/Connector/Connector.php | 12 ++++++++++++ .../Consumers/StoreChannelPropertyState.php | 4 ++++ src/Subscribers/Properties.php | 2 ++ src/Writers/Exchange.php | 8 ++++++++ src/Writers/Periodic.php | 15 +++++++++++++++ tests/cases/unit/BaseTestCase.php | 2 ++ tests/cases/unit/DI/VieraExtensionTest.php | 1 + 9 files changed, 65 insertions(+), 1 deletion(-) diff --git a/src/Clients/Discovery.php b/src/Clients/Discovery.php index be48692..8823d15 100644 --- a/src/Clients/Discovery.php +++ b/src/Clients/Discovery.php @@ -83,6 +83,9 @@ public function __construct( { } + /** + * @throws RuntimeException + */ public function discover(): void { $this->logger->debug( @@ -156,7 +159,7 @@ public function discover(): void $data .= "MX: 1\r\n"; $data .= "\r\n"; - $this->sender->send($data, sprintf('%s:%d', self::MCAST_HOST, self::MCAST_PORT)); + $this->sender?->send($data, sprintf('%s:%d', self::MCAST_HOST, self::MCAST_PORT)); } public function disconnect(): void diff --git a/src/Clients/Television.php b/src/Clients/Television.php index 08f436d..3202437 100644 --- a/src/Clients/Television.php +++ b/src/Clients/Television.php @@ -100,11 +100,15 @@ public function __construct( } /** + * @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 TypeError * @throws ValueError */ @@ -650,6 +654,19 @@ private function getDeviceClient(Documents\Devices\Device $device): API\Televisi : null; } + /** + * @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 TypeError + * @throws ValueError + */ private function registerLoopHandler(): void { $this->handlerTimer = $this->eventLoop->addTimer( diff --git a/src/Connector/Connector.php b/src/Connector/Connector.php index fbca91c..14243cd 100644 --- a/src/Connector/Connector.php +++ b/src/Connector/Connector.php @@ -18,16 +18,20 @@ use FastyBird\Connector\Viera; use FastyBird\Connector\Viera\Clients; use FastyBird\Connector\Viera\Documents; +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\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; use Nette; use React\EventLoop; use React\Promise; +use RuntimeException; use function assert; use function React\Async\async; @@ -72,8 +76,14 @@ public function __construct( /** * @return Promise\PromiseInterface * + * @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 { @@ -131,6 +141,8 @@ public function execute(bool $standalone = true): Promise\PromiseInterface /** * @return Promise\PromiseInterface + * + * @throws RuntimeException */ public function discover(): Promise\PromiseInterface { diff --git a/src/Queue/Consumers/StoreChannelPropertyState.php b/src/Queue/Consumers/StoreChannelPropertyState.php index a2c301b..1573a06 100644 --- a/src/Queue/Consumers/StoreChannelPropertyState.php +++ b/src/Queue/Consumers/StoreChannelPropertyState.php @@ -32,6 +32,8 @@ use Nette; use Nette\Utils; use Ramsey\Uuid; +use TypeError; +use ValueError; use function array_merge; use function React\Async\await; @@ -65,6 +67,8 @@ public function __construct( * @throws MetadataExceptions\InvalidArgument * @throws MetadataExceptions\InvalidState * @throws ToolsExceptions\InvalidArgument + * @throws TypeError + * @throws ValueError */ public function consume(Queue\Messages\Message $message): bool { diff --git a/src/Subscribers/Properties.php b/src/Subscribers/Properties.php index cca7877..3532215 100644 --- a/src/Subscribers/Properties.php +++ b/src/Subscribers/Properties.php @@ -103,6 +103,7 @@ public function postPersist(Persistence\Event\LifecycleEventArgs $eventArgs): vo * @throws Exceptions\InvalidArgument * @throws Exceptions\InvalidArgument * @throws MetadataExceptions\InvalidArgument + * @throws MetadataExceptions\InvalidState * @throws TypeError * @throws ValueError */ @@ -282,6 +283,7 @@ private function processChannelProperty( * @throws DoctrineCrud\Exceptions\InvalidArgumentException * @throws Exceptions\InvalidArgument * @throws MetadataExceptions\InvalidArgument + * @throws MetadataExceptions\InvalidState * @throws TypeError * @throws ValueError */ diff --git a/src/Writers/Exchange.php b/src/Writers/Exchange.php index 161aaac..ebdc070 100644 --- a/src/Writers/Exchange.php +++ b/src/Writers/Exchange.php @@ -24,7 +24,9 @@ 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\Documents as DevicesDocuments; use FastyBird\Module\Devices\Exceptions as DevicesExceptions; use FastyBird\Module\Devices\Models as DevicesModels; @@ -73,8 +75,14 @@ public function __construct( } /** + * @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 { diff --git a/src/Writers/Periodic.php b/src/Writers/Periodic.php index bb9c784..f2aaabe 100644 --- a/src/Writers/Periodic.php +++ b/src/Writers/Periodic.php @@ -88,7 +88,13 @@ public function __construct( } /** + * @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 { @@ -266,6 +272,15 @@ private function writeProperty(Documents\Devices\Device $device): bool return false; } + /** + * @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 { $this->handlerTimer = $this->eventLoop->addTimer( diff --git a/tests/cases/unit/BaseTestCase.php b/tests/cases/unit/BaseTestCase.php index f8e2172..adeb24d 100644 --- a/tests/cases/unit/BaseTestCase.php +++ b/tests/cases/unit/BaseTestCase.php @@ -22,6 +22,7 @@ abstract class BaseTestCase extends TestCase /** * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState * @throws Error */ protected function setUp(): void @@ -33,6 +34,7 @@ protected function setUp(): void /** * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState * @throws Error */ protected function createContainer(string|null $additionalConfig = null): Nette\DI\Container diff --git a/tests/cases/unit/DI/VieraExtensionTest.php b/tests/cases/unit/DI/VieraExtensionTest.php index 76846be..37215ba 100644 --- a/tests/cases/unit/DI/VieraExtensionTest.php +++ b/tests/cases/unit/DI/VieraExtensionTest.php @@ -23,6 +23,7 @@ final class VieraExtensionTest extends Tests\Cases\Unit\BaseTestCase /** * @throws ApplicationExceptions\InvalidArgument + * @throws ApplicationExceptions\InvalidState * @throws Nette\DI\MissingServiceException * @throws Error */