Skip to content

Commit

Permalink
Refactoring UI components (#252)
Browse files Browse the repository at this point in the history
actions-user committed May 3, 2024
1 parent 2954841 commit f3776af
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/Commands/Discover.php
Original file line number Diff line number Diff line change
@@ -167,7 +167,7 @@ protected function execute(Input\InputInterface $input, Output\OutputInterface $
);
usort(
$systemConnectors,
static fn (Documents\Connectors\Connector $a, Documents\Connectors\Connector $b): int => $a->getIdentifier() <=> $b->getIdentifier()
static fn (Documents\Connectors\Connector $a, Documents\Connectors\Connector $b): int => $a->getIdentifier() <=> $b->getIdentifier(),
);

foreach ($systemConnectors as $connector) {
2 changes: 1 addition & 1 deletion src/Commands/Execute.php
Original file line number Diff line number Diff line change
@@ -152,7 +152,7 @@ protected function execute(Input\InputInterface $input, Output\OutputInterface $
);
usort(
$systemConnectors,
static fn (Documents\Connectors\Connector $a, Documents\Connectors\Connector $b): int => $a->getIdentifier() <=> $b->getIdentifier()
static fn (Documents\Connectors\Connector $a, Documents\Connectors\Connector $b): int => $a->getIdentifier() <=> $b->getIdentifier(),
);

foreach ($systemConnectors as $connector) {
14 changes: 7 additions & 7 deletions src/Entities/Connectors/Connector.php
Original file line number Diff line number Diff line change
@@ -85,7 +85,7 @@ public function getClientMode(): Types\ClientMode
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::CLIENT_MODE->value
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::CLIENT_MODE->value,
)
->first();

@@ -110,7 +110,7 @@ public function getOpenApiEndpoint(): Types\OpenApiEndpoint
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::OPENAPI_ENDPOINT->value
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::OPENAPI_ENDPOINT->value,
)
->first();

@@ -136,7 +136,7 @@ public function getOpenPulsarEndpoint(): Types\OpenPulsarEndpoint
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::OPENPULSAR_ENDPOINT->value
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::OPENPULSAR_ENDPOINT->value,
)
->first();

@@ -176,7 +176,7 @@ public function getOpenPulsarTopic(): Types\OpenPulsarTopic
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::OPENPULSAR_TOPIC->value
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::OPENPULSAR_TOPIC->value,
)
->first();

@@ -202,7 +202,7 @@ public function getAccessId(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::ACCESS_ID->value
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::ACCESS_ID->value,
)
->first();

@@ -227,7 +227,7 @@ public function getAccessSecret(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::ACCESS_SECRET->value
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::ACCESS_SECRET->value,
)
->first();

@@ -252,7 +252,7 @@ public function getUid(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::UID->value
static fn (DevicesEntities\Connectors\Properties\Property $property): bool => $property->getIdentifier() === Types\ConnectorPropertyIdentifier::UID->value,
)
->first();

22 changes: 11 additions & 11 deletions src/Entities/Devices/Device.php
Original file line number Diff line number Diff line change
@@ -114,7 +114,7 @@ public function getProtocolVersion(): Types\DeviceProtocolVersion
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::PROTOCOL_VERSION->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::PROTOCOL_VERSION->value,
)
->first();

@@ -156,7 +156,7 @@ public function getNodeId(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::NODE_ID->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::NODE_ID->value,
)
->first();

@@ -181,7 +181,7 @@ public function getGatewayId(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::GATEWAY_ID->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::GATEWAY_ID->value,
)
->first();

@@ -206,7 +206,7 @@ public function getIpAddress(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::IP_ADDRESS->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::IP_ADDRESS->value,
)
->first();

@@ -231,7 +231,7 @@ public function getLocalKey(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::LOCAL_KEY->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::LOCAL_KEY->value,
)
->first();

@@ -256,7 +256,7 @@ public function isEncrypted(): bool
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::ENCRYPTED->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::ENCRYPTED->value,
)
->first();

@@ -283,7 +283,7 @@ public function getExcludedDps(): array
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::READ_STATE_EXCLUDE_DPS->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::READ_STATE_EXCLUDE_DPS->value,
)
->first();

@@ -308,7 +308,7 @@ public function getModel(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::MODEL->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::MODEL->value,
)
->first();

@@ -333,7 +333,7 @@ public function getMacAddress(): string|null
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::MAC_ADDRESS->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::MAC_ADDRESS->value,
)
->first();

@@ -358,7 +358,7 @@ public function getStateReadingDelay(): float
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::STATE_READING_DELAY->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::STATE_READING_DELAY->value,
)
->first();

@@ -383,7 +383,7 @@ public function getHeartbeatDelay(): float
$property = $this->properties
->filter(
// phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::HEARTBEAT_DELAY->value
static fn (DevicesEntities\Devices\Properties\Property $property): bool => $property->getIdentifier() === Types\DevicePropertyIdentifier::HEARTBEAT_DELAY->value,
)
->first();

0 comments on commit f3776af

Please sign in to comment.