12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
W, [2025-02-18T03:07:35.974879 #1] WARN -- : Skipping src/Service/GatewayApiService.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:35.974950 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:35.979217 #1] WARN -- : Skipping src/Service/ServiceInterface.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:35.979260 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:35.991012 #1] WARN -- : Skipping src/Serializer/Normalizer/GroupMembersNormalizer.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:35.991051 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:35.994531 #1] WARN -- : Skipping src/Serializer/Normalizer/ArrayNestingNormalizer.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:35.994567 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:35.997482 #1] WARN -- : Skipping src/Serializer/Normalizer/CratedAtNormalizer.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:35.997515 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.001343 #1] WARN -- : Skipping src/Serializer/JsonDeviceDataSerializer.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.001458 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.004391 #1] WARN -- : Skipping src/Command/Put.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.004464 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.007246 #1] WARN -- : Skipping src/Command/AbstractCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.007320 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.012397 #1] WARN -- : Skipping src/Command/Post.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.012482 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.016724 #1] WARN -- : Skipping src/Command/GatewayHelperCommands.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.016900 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.032926 #1] WARN -- : Skipping src/Command/Coap/Group/GroupSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.033010 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.036994 #1] WARN -- : Skipping src/Command/Coap/Group/GroupDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.037032 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.044423 #1] WARN -- : Skipping src/Command/Coap/Keys.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.044464 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.047933 #1] WARN -- : Skipping src/Command/Coap/Receiver.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.047968 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.052165 #1] WARN -- : Skipping src/Command/Coap/Light/LightSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.053270 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.056150 #1] WARN -- : Skipping src/Command/Coap/Light/LightDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.056190 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.058974 #1] WARN -- : Skipping src/Command/Coap/Light/LightChangeLightTemperatureCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.059010 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.061874 #1] WARN -- : Skipping src/Command/Coap/Blinds/BlindsGetCurrentPositionCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.061909 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.067931 #1] WARN -- : Skipping src/Command/Get.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.067963 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.124012 #1] WARN -- : Skipping src/Adapter/CoapAdapter.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.124112 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.183475 #1] WARN -- : Skipping src/Dto/CoapResponse/DeviceDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.183522 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.186277 #1] WARN -- : Skipping src/Dto/CoapResponse/BlindControlDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.186333 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.188852 #1] WARN -- : Skipping src/Dto/CoapResponse/LightControlDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.188886 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.191501 #1] WARN -- : Skipping src/Dto/CoapResponse/DeviceInfoDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.191534 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.195089 #1] WARN -- : Skipping src/Dto/CoapResponse/GroupDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.195120 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.198093 #1] WARN -- : Skipping src/Dto/CoapGatewayRequestPayloadDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.198132 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.201120 #1] WARN -- : Skipping src/Dto/CoapGatewayAuthConfigDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.201157 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.271953 #1] WARN -- : Skipping src/Device/Helper/Type.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.271990 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:36.323254 #1] WARN -- : Skipping src/Factory/GatewayServiceFactory.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:36.323292 #1] WARN -- : Response status: 422
|
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
W, [2025-02-18T03:07:40.074024 #1] WARN -- : Skipping ./src/Service/GatewayApiService.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.074073 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.076493 #1] WARN -- : Skipping ./src/Service/ServiceInterface.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.076570 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.085049 #1] WARN -- : Skipping ./src/Serializer/Normalizer/GroupMembersNormalizer.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.085077 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.089320 #1] WARN -- : Skipping ./src/Serializer/Normalizer/ArrayNestingNormalizer.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.089581 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.093951 #1] WARN -- : Skipping ./src/Serializer/Normalizer/CratedAtNormalizer.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.094154 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.094119 #1] WARN -- : Skipping ./src/Serializer/JsonDeviceDataSerializer.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.094545 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.096595 #1] WARN -- : Skipping ./src/Command/Put.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.096622 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.098040 #1] WARN -- : Skipping ./src/Command/AbstractCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.098074 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.099245 #1] WARN -- : Skipping ./src/Command/Post.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.099281 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.101673 #1] WARN -- : Skipping ./src/Command/GatewayHelperCommands.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.101700 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.105380 #1] WARN -- : Skipping ./src/Command/Coap/Group/GroupSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.105696 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.108611 #1] WARN -- : Skipping ./src/Command/Coap/Group/GroupDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.108646 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.111927 #1] WARN -- : Skipping ./src/Command/Coap/Keys.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.111962 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.112813 #1] WARN -- : Skipping ./src/Command/Coap/Receiver.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.112848 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.114210 #1] WARN -- : Skipping ./src/Command/Coap/Light/LightSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.114246 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.115419 #1] WARN -- : Skipping ./src/Command/Coap/Light/LightDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.115453 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.116890 #1] WARN -- : Skipping ./src/Command/Coap/Light/LightChangeLightTemperatureCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.116922 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.117940 #1] WARN -- : Skipping ./src/Command/Coap/Blinds/BlindsGetCurrentPositionCommand.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.117974 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.120905 #1] WARN -- : Skipping ./src/Command/Get.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.120941 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.155892 #1] WARN -- : Skipping ./src/Adapter/CoapAdapter.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.155947 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.188239 #1] WARN -- : Skipping ./src/Dto/CoapResponse/DeviceDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.204010 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.207173 #1] WARN -- : Skipping ./src/Dto/CoapResponse/BlindControlDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.207208 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.208714 #1] WARN -- : Skipping ./src/Dto/CoapResponse/LightControlDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.208911 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.210178 #1] WARN -- : Skipping ./src/Dto/CoapResponse/DeviceInfoDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.210382 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.212835 #1] WARN -- : Skipping ./src/Dto/CoapResponse/GroupDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.212862 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.214749 #1] WARN -- : Skipping ./src/Dto/CoapGatewayRequestPayloadDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.214886 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.216847 #1] WARN -- : Skipping ./src/Dto/CoapGatewayAuthConfigDto.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.218948 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.270696 #1] WARN -- : Skipping ./src/Device/Helper/Type.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.270734 #1] WARN -- : Response status: 422
W, [2025-02-18T03:07:40.312547 #1] WARN -- : Skipping ./src/Factory/GatewayServiceFactory.php due to CC::Parser::Client::HTTPError
W, [2025-02-18T03:07:40.312588 #1] WARN -- : Response status: 422
|
INFO: Java 1.8.0_322 Amazon.com Inc. (64-bit)
INFO: Linux 4.4.0-1128-aws amd64
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-core-2.17.0.899.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/src/app/build/libs/sonarlint-cli-2.1.0.566.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
INFO: Index files
INFO: 100 files indexed
INFO: 81 source files to be analyzed
ERROR: Unable to parse file: /code/src/Service/GatewayApiService.php
ERROR: Parse error at line 31 column 18:
21: use IKEA\Tradfri\Device\Feature\BrightnessStateInterface;
22: use IKEA\Tradfri\Device\Feature\DeviceInterface;
23: use IKEA\Tradfri\Device\Feature\SwitchableInterface;
24: use IKEA\Tradfri\Device\LightBulb;
25: use IKEA\Tradfri\Device\RollerBlind;
26: use IKEA\Tradfri\Exception\RuntimeException;
27: use IKEA\Tradfri\Group\LightGroup;
28:
29: final class GatewayApiService implements ServiceInterface
30: {
31: final public const INVALID_DEVICE_TYPE = 'invalid device type: ';
^
32:
33: public function __construct(protected ClientInterface $client)
34: {
35: }
36:
37: public function getLights(): LightBulbs
38: {
39: return $this->getDevices()->getLightBulbs();
40: }
41:
ERROR: Unable to parse file: /code/src/Service/ServiceInterface.php
ERROR: Parse error at line 38 column 40:
28: public function getDevices(): Devices;
29:
30: /**
31: * @throws \IKEA\Tradfri\Exception\RuntimeException
32: */
33: public function allLightsOff(LightBulbs $lightBulbsCollection): bool;
34:
35: /**
36: * @throws \IKEA\Tradfri\Exception\RuntimeException
37: */
38: public function on(DeviceInterface&SwitchableInterface $device): bool;
^
39:
40: /**
41: * @throws \IKEA\Tradfri\Exception\RuntimeException
42: */
43: public function off(DeviceInterface&SwitchableInterface $device): bool;
44:
45: /**
46: * @throws \IKEA\Tradfri\Exception\RuntimeException
47: */
48: public function dim(BrightnessStateInterface&DeviceInterface $device, int $level): bool;
ERROR: Unable to parse file: /code/src/Serializer/Normalizer/GroupMembersNormalizer.php
ERROR: Parse error at line 26 column 9:
16: use IKEA\Tradfri\Dto\CoapResponse\GroupDto;
17: use Psr\Log\LoggerAwareInterface;
18: use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
19: use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
20:
21: final class GroupMembersNormalizer implements DenormalizerInterface, LoggerAwareInterface, NormalizerInterface
22: {
23: use \Psr\Log\LoggerAwareTrait;
24:
25: public function __construct(
26: private readonly DenormalizerInterface&NormalizerInterface $normalizer,
^
27: ) {
28: }
29:
30: public function normalize(mixed $object, ?string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string
31: {
32: return $this->normalizer->normalize($object, $format, $context);
33: }
34:
35: public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
36: {
ERROR: Unable to parse file: /code/src/Serializer/Normalizer/ArrayNestingNormalizer.php
ERROR: Parse error at line 23 column 18:
13:
14: namespace IKEA\Tradfri\Serializer\Normalizer;
15:
16: use Psr\Log\LoggerAwareInterface;
17: use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
18: use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
19:
20: final class ArrayNestingNormalizer implements DenormalizerInterface, LoggerAwareInterface, NormalizerInterface
21: {
22: use \Psr\Log\LoggerAwareTrait;
23: final public const ATTR_LIGHT_CONTROL = 'ATTR_LIGHT_CONTROL';
^
24: final public const ATTR_DEVICE_STATE = 'ATTR_DEVICE_STATE';
25:
26: public function __construct(
27: private readonly DenormalizerInterface&NormalizerInterface $normalizer,
28: ) {
29: }
30:
31: public function normalize(mixed $object, ?string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string
32: {
33: return $this->normalizer->normalize($object, $format, $context);
ERROR: Unable to parse file: /code/src/Serializer/Normalizer/CratedAtNormalizer.php
ERROR: Parse error at line 25 column 9:
15:
16: use Psr\Log\LoggerAwareInterface;
17: use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
18: use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
19:
20: final class CratedAtNormalizer implements DenormalizerInterface, LoggerAwareInterface, NormalizerInterface
21: {
22: use \Psr\Log\LoggerAwareTrait;
23:
24: public function __construct(
25: private readonly DenormalizerInterface&NormalizerInterface $normalizer,
^
26: ) {
27: }
28:
29: public function normalize(mixed $object, ?string $format = null, array $context = []): null|array|\ArrayObject|bool|float|int|string
30: {
31: return $this->normalizer->normalize($object, $format, $context);
32: }
33:
34: public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool
35: {
ERROR: Unable to parse file: /code/src/Serializer/JsonDeviceDataSerializer.php
ERROR: Parse error at line 30 column 18:
20: use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
21: use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
22: use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter;
23: use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
24: use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
25: use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
26: use Symfony\Component\Serializer\Serializer;
27:
28: final class JsonDeviceDataSerializer implements \Symfony\Component\Serializer\SerializerInterface
29: {
30: final public const FORMAT = JsonEncoder::FORMAT;
^
31: private Serializer $serializer;
32:
33: public function __construct()
34: {
35: $this->initSerializer();
36: }
37:
38: public function deserialize(mixed $data, string $type, string $format, array $context = []): array|DeviceDto|GroupDto
39: {
40: return $this->serializer->deserialize(
ERROR: Unable to parse file: /code/src/Command/Put.php
ERROR: Parse error at line 24 column 18:
14: namespace IKEA\Tradfri\Command;
15:
16: use IKEA\Tradfri\Helper\CommandRunnerInterface;
17: use IKEA\Tradfri\Values\CoapCommandPattern;
18:
19: /**
20: * @final
21: */
22: class Put extends AbstractCommand
23: {
24: final public const COAP_COMMAND = 'coap-client -m put -u "%s" -k "%s"';
^
25: private const COAP_COMMAND_FORMAT = '%s %s "%s/%s"';
26:
27: public function __construct(\IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto $authConfig)
28: {
29: parent::__construct($authConfig, CoapCommandPattern::PUT);
30: }
31:
32: public function requestCommand(Request|string $request, string $payload): string
33: {
34: if ($request instanceof Request) {
ERROR: Unable to parse file: /code/src/Command/AbstractCommand.php
ERROR: Parse error at line 21 column 9:
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Command;
15:
16: use IKEA\Tradfri\Helper\CommandRunnerInterface;
17:
18: abstract class AbstractCommand implements CommandInterface
19: {
20: public function __construct(
21: protected readonly \IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto $authConfig,
^
22: protected \IKEA\Tradfri\Values\CoapCommandPattern $commandPattern,
23: ) {
24: }
25:
26: public function __toString(): string
27: {
28: return $this->command();
29: }
30:
31: final public function command(): string
ERROR: Unable to parse file: /code/src/Command/Post.php
ERROR: Parse error at line 21 column 18:
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Command;
15:
16: use IKEA\Tradfri\Helper\CommandRunnerInterface;
17: use IKEA\Tradfri\Values\CoapCommandPattern;
18:
19: final class Post extends AbstractCommand
20: {
21: final public const COAP_COMMAND = 'coap-client -m post -u "%s" -k "%s"';
^
22: private const COAP_COMMAND_FORMAT = '%s %s "%s/%s"';
23:
24: public function __construct(\IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto $authConfig)
25: {
26: parent::__construct($authConfig, CoapCommandPattern::POST);
27: }
28:
29: public function requestCommand(Request|string $request, string $payload): string
30: {
31: if ($request instanceof Request) {
ERROR: Unable to parse file: /code/src/Command/GatewayHelperCommands.php
ERROR: Parse error at line 21 column 7:
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Command;
15:
16: use IKEA\Tradfri\Command\Coap\Keys;
17: use IKEA\Tradfri\Exception\RuntimeException;
18: use IKEA\Tradfri\Helper\CommandRunner;
19: use IKEA\Tradfri\Helper\CommandRunnerInterface;
20:
21: final readonly class GatewayHelperCommands
^
22: {
23: /**
24: * @throws \InvalidArgumentException
25: * @throws RuntimeException
26: */
27: public function __construct(
28: private \IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto $authConfig,
29: private CommandRunnerInterface $runner = new CommandRunner(),
30: ) {
31: }
ERROR: Unable to parse file: /code/src/Command/Request.php
ERROR: Parse error at line 16 column 6:
6: * Copyright (c) 2024 Benjamin Fahl
7: *
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Command;
15:
16: enum Request: string
^
17: {
18: case RootDevices = Coap\Keys::ROOT_DEVICES;
19: case RootGroups = Coap\Keys::ROOT_GROUPS;
20: case RootGateway = Coap\Keys::ROOT_GATEWAY;
21:
22: public function withTargetId(int|string $deviceId): string
23: {
24: return $this->value . '/' . $deviceId;
25: }
26: }
ERROR: Unable to parse file: /code/src/Command/Coap/Group/GroupSwitchStateCommand.php
ERROR: Parse error at line 27 column 9:
17: use IKEA\Tradfri\Command\Put;
18: use IKEA\Tradfri\Command\Request;
19: use IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto;
20: use IKEA\Tradfri\Dto\CoapGatewayRequestPayloadDto;
21: use IKEA\Tradfri\Helper\CommandRunnerInterface;
22:
23: final class GroupSwitchStateCommand extends Put
24: {
25: public function __construct(
26: CoapGatewayAuthConfigDto $authConfig,
27: private readonly int $groupId,
^
28: private readonly bool $state,
29: ) {
30: parent::__construct($authConfig);
31: }
32:
33: public function __toString(): string
34: {
35: return $this->requestCommand(
36: Request::RootGroups->withTargetId($this->groupId),
37: CoapGatewayRequestPayloadDto::fromValues(
ERROR: Unable to parse file: /code/src/Command/Coap/Group/GroupDimmerCommand.php
ERROR: Parse error at line 26 column 9:
16: use IKEA\Tradfri\Command\Coap\Keys;
17: use IKEA\Tradfri\Command\Put;
18: use IKEA\Tradfri\Command\Request;
19: use IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto;
20: use IKEA\Tradfri\Dto\CoapGatewayRequestPayloadDto;
21:
22: final class GroupDimmerCommand extends Put
23: {
24: public function __construct(
25: CoapGatewayAuthConfigDto $authConfig,
26: private readonly int $groupId,
^
27: private readonly int $level,
28: ) {
29: parent::__construct($authConfig);
30: }
31:
32: public function __toString(): string
33: {
34: return $this->requestCommand(
35: Request::RootGroups->withTargetId($this->groupId),
36: CoapGatewayRequestPayloadDto::fromValues(
ERROR: Unable to parse file: /code/src/Command/Coap/Keys.php
ERROR: Parse error at line 24 column 18:
14: namespace IKEA\Tradfri\Command\Coap;
15:
16: /**
17: * @todo: enum
18: *
19: * @see Source and Thanks to "ggravlingen"
20: * https://github.com/ggravlingen/pytradfri/blob/master/pytradfri/const.py
21: */
22: final class Keys
23: {
24: final public const ROOT_DEVICES = '15001';
^
25: final public const ROOT_GATEWAY = '15011';
26: final public const ROOT_GROUPS = '15004';
27: final public const ROOT_MOODS = '15005';
28: final public const ROOT_NOTIFICATION = '15006'; // speculative name
29: final public const ROOT_REMOTE_CONTROL = '15009';
30: final public const ROOT_SIGNAL_REPEATER = '15014';
31: final public const ROOT_SMART_TASKS = '15010';
32: final public const ROOT_START_ACTION = '15013'; // found under ATTR_START_ACTION
33: final public const ATTR_START_BLINDS = '15015';
34: final public const ROOT_AIR_PURIFIER = '15025';
ERROR: Unable to parse file: /code/src/Command/Coap/Receiver.php
ERROR: Parse error at line 21 column 18:
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Command\Coap;
15:
16: /**
17: * Receiver is specific service with its own contract and can be only concrete.
18: */
19: final class Receiver
20: {
21: final public const COAP_COMMAND = '%s invalid %s';
^
22: private string $requestType;
23: private string $injectCommand;
24:
25: /**
26: * @var list<string>
27: */
28: private array $output = [];
29:
30: public function __construct(
31: protected string $ipAddress,
ERROR: Unable to parse file: /code/src/Command/Coap/Light/LightSwitchStateCommand.php
ERROR: Parse error at line 27 column 9:
17: use IKEA\Tradfri\Command\Put;
18: use IKEA\Tradfri\Command\Request;
19: use IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto;
20: use IKEA\Tradfri\Dto\CoapGatewayRequestPayloadDto;
21: use IKEA\Tradfri\Helper\CommandRunnerInterface;
22:
23: final class LightSwitchStateCommand extends Put
24: {
25: public function __construct(
26: CoapGatewayAuthConfigDto $authConfig,
27: private readonly int $deviceId,
^
28: private readonly bool $state,
29: ) {
30: parent::__construct($authConfig);
31: }
32:
33: public function __toString(): string
34: {
35: return $this->requestCommand(
36: Request::RootDevices->withTargetId($this->deviceId),
37: (string) CoapGatewayRequestPayloadDto::fromValues(
ERROR: Unable to parse file: /code/src/Command/Coap/Light/LightDimmerCommand.php
ERROR: Parse error at line 26 column 9:
16: use IKEA\Tradfri\Command\Coap\Keys;
17: use IKEA\Tradfri\Command\Put;
18: use IKEA\Tradfri\Command\Request;
19: use IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto;
20: use IKEA\Tradfri\Dto\CoapGatewayRequestPayloadDto;
21:
22: final class LightDimmerCommand extends Put
23: {
24: public function __construct(
25: CoapGatewayAuthConfigDto $authConfig,
26: private readonly int $deviceId,
^
27: private readonly int $value,
28: ) {
29: parent::__construct($authConfig);
30: }
31:
32: public function __toString(): string
33: {
34: return $this->requestCommand(
35: Request::RootDevices->withTargetId($this->deviceId),
36: (string) CoapGatewayRequestPayloadDto::fromValues(
ERROR: Unable to parse file: /code/src/Command/Coap/Light/LightChangeLightTemperatureCommand.php
ERROR: Parse error at line 24 column 9:
14: namespace IKEA\Tradfri\Command\Coap\Light;
15:
16: use IKEA\Tradfri\Command\Put;
17: use IKEA\Tradfri\Command\Request;
18: use IKEA\Tradfri\Dto\CoapGatewayRequestPayloadDto;
19:
20: final class LightChangeLightTemperatureCommand extends Put
21: {
22: public function __construct(
23: \IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto $authConfig,
24: private readonly int $deviceId,
^
25: /**
26: * @phpstan-param value-of<\IKEA\Tradfri\Dto\CoapGatewayRequestPayloadDto::COLORS>|string $color
27: */
28: private readonly string $color,
29: ) {
30: parent::__construct($authConfig);
31: }
32:
33: public function __toString(): string
34: {
ERROR: Unable to parse file: /code/src/Command/Coap/Blinds/BlindsGetCurrentPositionCommand.php
ERROR: Parse error at line 26 column 9:
16: use IKEA\Tradfri\Command\Coap\Keys;
17: use IKEA\Tradfri\Command\Put;
18: use IKEA\Tradfri\Command\Request;
19: use IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto;
20: use IKEA\Tradfri\Dto\CoapGatewayRequestPayloadDto;
21:
22: final class BlindsGetCurrentPositionCommand extends Put
23: {
24: public function __construct(
25: CoapGatewayAuthConfigDto $authConfig,
26: private readonly int $deviceId,
^
27: private readonly int $value,
28: ) {
29: parent::__construct($authConfig);
30: }
31:
32: public function __toString(): string
33: {
34: return $this->requestCommand(
35: Request::RootDevices->withTargetId($this->deviceId),
36: (string) CoapGatewayRequestPayloadDto::fromValues(
ERROR: Unable to parse file: /code/src/Command/Get.php
ERROR: Parse error at line 21 column 18:
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Command;
15:
16: use IKEA\Tradfri\Helper\CommandRunnerInterface;
17: use IKEA\Tradfri\Values\CoapCommandPattern;
18:
19: final class Get extends AbstractCommand
20: {
21: final public const COAP_COMMAND = 'coap-client -m get -u "%s" -k "%s"';
^
22: private const COAP_COMMAND_FORMAT = '%s "%s/%s"';
23: private const COAP_COMMAND_FORMAT_WITH_DEVICE_ID = '%s "%s/%s/%s"';
24:
25: public function __construct(\IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto $authConfig)
26: {
27: parent::__construct($authConfig, CoapCommandPattern::GET);
28: }
29:
30: public function requestCommand(Request|string $request, ?int $deviceId = null): string
31: {
ERROR: Unable to parse file: /code/src/Group/DeviceGroup.php
ERROR: Parse error at line 37 column 15:
27:
28: /**
29: * @final
30: */
31: class DeviceGroup implements \JsonSerializable, BooleanStateInterface, BrightnessStateInterface, DeviceInterface, SwitchableInterface
32: {
33: use ProvidesId;
34: use ProvidesName;
35: use ProvidesState;
36: use \IKEA\Tradfri\Traits\ProvidesBrightness;
37: protected GatewayApiService|ServiceInterface $_service;
^
38: protected Devices $_devices;
39: protected array $_deviceIds = [];
40:
41: public function __construct(int $deviceId, ServiceInterface $service)
42: {
43: $this->setId($deviceId);
44: $this->setService($service);
45: }
46:
47: public function setService(ServiceInterface $service): self
ERROR: Unable to parse file: /code/src/Mapper/MapperInterface.php
ERROR: Parse error at line 33 column 5:
23: {
24: /**
25: * @phpstan-param AbstractCollection $collection
26: *
27: * @phpstan-return AbstractCollection
28: */
29: public function map(
30: ServiceInterface $service,
31: iterable $dataItems,
32: AbstractCollection $collection,
33: ): AbstractCollection;
^
34: }
35:
ERROR: Unable to parse file: /code/src/Mapper/GroupData.php
ERROR: Parse error at line 41 column 5:
31:
32: /**
33: * @phpstan-param Groups $collection
34: *
35: * @phpstan-return Groups
36: */
37: public function map(
38: ServiceInterface $service,
39: iterable $dataItems,
40: AbstractCollection $collection,
41: ): AbstractCollection {
^
42: foreach ($dataItems as $groupDto) {
43: if (!$groupDto instanceof \IKEA\Tradfri\Dto\CoapResponse\GroupDto) {
44: $this->logger?->warning('invalid device detected - skipped', ['device' => \serialize($groupDto), 'type' => \get_debug_type($groupDto)]);
45: continue;
46: }
47:
48: $group = new DeviceGroup(
49: $groupDto->getId(),
50: $service,
51: );
ERROR: Unable to parse file: /code/src/Mapper/DeviceData.php
ERROR: Parse error at line 50 column 5:
40: *
41: * @phpstan-param T $collection
42: * @phpstan-param DeviceDto[] $dataItems
43: *
44: * @phpstan-return T
45: */
46: public function map(
47: ServiceInterface $service,
48: iterable $dataItems,
49: \IKEA\Tradfri\Collection\AbstractCollection $collection = new Devices(),
50: ): \IKEA\Tradfri\Collection\AbstractCollection {
^
51: foreach ($dataItems as $device) {
52: if (!$device instanceof DeviceDto) {
53: $this->logger?->warning('invalid device detected - skipped', ['device' => \serialize($device), 'type' => \get_debug_type($device)]);
54: continue;
55: }
56:
57: $model = $this->getModel(
58: $device,
59: );
60: $model->setService($service);
ERROR: Unable to parse file: /code/src/Adapter/CoapAdapter.php
ERROR: Parse error at line 47 column 9:
37: use IKEA\Tradfri\Util\JsonIntTypeNormalizer;
38: use Psr\Log\LoggerAwareInterface;
39: use Psr\Log\LoggerAwareTrait;
40:
41: final class CoapAdapter implements AdapterInterface, LoggerAwareInterface
42: {
43: use LoggerAwareTrait;
44: private const COULD_NOT_SWITCH_STATE = 'Could not switch state';
45:
46: public function __construct(
47: private readonly CoapGatewayAuthConfigDto $authConfig,
^
48: private readonly GatewayHelperCommands $commands,
49: private readonly DeviceData $deviceDataMapper,
50: private readonly GroupData $groupDataMapper,
51: private readonly CommandRunnerInterface $runner = new CommandRunner(),
52: private readonly JsonDeviceDataSerializer $deviceSerializer = new JsonDeviceDataSerializer(),
53: ) {
54: }
55:
56: /**
57: * @throws \JsonException|RuntimeException
ERROR: Unable to parse file: /code/src/Validator/Device/DeviceObjectPropertyValidator.php
ERROR: Parse error at line 46 column 28:
36:
37: $this->_hasDataField($device);
38:
39: $data = $this->_getData($device);
40:
41: $this->_hasDataType($data);
42:
43: $this->_hasDataManufacturer($data);
44:
45: $this->_hasDataVersion($data);
46: } catch (\Throwable) {
^
47: $isValid = false;
48: }
49:
50: return $isValid;
51: }
52:
53: /**
54: * @throws RuntimeException
55: */
56: private function _hasIdField(\stdClass $device): void
ERROR: Unable to parse file: /code/src/Dto/CoapResponse/DeviceDto.php
ERROR: Parse error at line 19 column 7:
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Dto\CoapResponse;
15:
16: use Symfony\Component\Serializer\Annotation\SerializedName;
17: use Symfony\Component\Validator\Constraints as Assert;
18:
19: final readonly class DeviceDto
^
20: {
21: public const ATTR_MAP = [
22: // - root node
23: '"ATTR_ID"' => '#"' . \IKEA\Tradfri\Dto\CoapApiResponseDto::ATTR_ID . '"#',
24: '"ATTR_NAME"' => '#"' . \IKEA\Tradfri\Dto\CoapApiResponseDto::ATTR_NAME . '"#',
25: // - device info = node
26: '"ATTR_DEVICE_INFO"' => '#"' . \IKEA\Tradfri\Dto\CoapApiResponseDto::ATTR_DEVICE_INFO . '"#',
27: '"ATTR_DEVICE_MODEL_NUMBER"' => '#"' . \IKEA\Tradfri\Dto\CoapApiResponseDto::ATTR_DEVICE_MODEL_NUMBER . '"#',
28: '"ATTR_DEVICE_FIRMWARE_VERSION"' => '#"' . \IKEA\Tradfri\Dto\CoapApiResponseDto::ATTR_DEVICE_FIRMWARE_VERSION . '"#',
29: '"ATTR_DEVICE_MANUFACTURER"' => '#"' . \IKEA\Tradfri\Dto\CoapApiResponseDto::ATTR_DEVICE_MANUFACTURER . '"#',
ERROR: Unable to parse file: /code/src/Dto/CoapResponse/BlindControlDto.php
ERROR: Parse error at line 18 column 7:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Dto\CoapResponse;
15:
16: use Symfony\Component\Serializer\Annotation\SerializedName;
17:
18: final readonly class BlindControlDto
^
19: {
20: public function __construct(
21: #[SerializedName(serializedName: 'ATTR_BLIND_CURRENT_POSITION')]
22: private int $state = 0,
23: ) {
24: }
25:
26: public function getState(): int
27: {
28: return $this->state;
ERROR: Unable to parse file: /code/src/Dto/CoapResponse/LightControlDto.php
ERROR: Parse error at line 18 column 7:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Dto\CoapResponse;
15:
16: use Symfony\Component\Serializer\Annotation\SerializedName;
17:
18: final readonly class LightControlDto
^
19: {
20: public function __construct(
21: #[SerializedName(serializedName: 'ATTR_DEVICE_STATE')]
22: private int $state = 0,
23: #[SerializedName(serializedName: 'ATTR_LIGHT_DIMMER')]
24: private int $brightness = 0,
25: #[SerializedName(serializedName: 'ATTR_LIGHT_COLOR_HEX')]
26: private ?string $colorHex = null,
27: ) {
28: }
ERROR: Unable to parse file: /code/src/Dto/CoapResponse/DeviceInfoDto.php
ERROR: Parse error at line 18 column 7:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Dto\CoapResponse;
15:
16: use Symfony\Component\Serializer\Annotation\SerializedName;
17:
18: final readonly class DeviceInfoDto
^
19: {
20: public function __construct(
21: #[SerializedName(serializedName: 'ATTR_DEVICE_MANUFACTURER')]
22: private string $manufacturer,
23: #[SerializedName(serializedName: 'ATTR_DEVICE_MODEL_NUMBER')]
24: private string $type,
25: #[SerializedName(serializedName: 'ATTR_DEVICE_FIRMWARE_VERSION')]
26: private string $version,
27: ) {
28: }
ERROR: Unable to parse file: /code/src/Dto/CoapResponse/GroupDto.php
ERROR: Parse error at line 19 column 7:
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Dto\CoapResponse;
15:
16: use Symfony\Component\Serializer\Annotation\SerializedName;
17: use Symfony\Component\Validator\Constraints as Assert;
18:
19: final readonly class GroupDto
^
20: {
21: public const KEY_ATTR_GROUP_MEMBERS ='ATTR_GROUP_MEMBERS';
22: public const KEY_ATTR_GROUP_LIGHTS ='ATTR_GROUP_LIGHTS';
23:
24: /**
25: * {
26: * '9001/ATTR_NAME':'Küche 2',
27: * '9002/ATTR_CREATED_AT':1547309682,
28: * '9003/ATTR_ID':177817,
29: * '5850/ATTR_DEVICE_STATE':0,
ERROR: Unable to parse file: /code/src/Dto/CoapGatewayRequestPayloadDto.php
ERROR: Parse error at line 19 column 7:
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Dto;
15:
16: use IKEA\Tradfri\Command\Coap\Keys;
17: use IKEA\Tradfri\Exception\RuntimeException;
18:
19: final readonly class CoapGatewayRequestPayloadDto implements \Stringable
^
20: {
21: public const COLOR_WARM = 'warm';
22: public const COLOR_NORMAL = 'normal';
23: public const COLOR_COLD = 'cold';
24: private const COLORS = [
25: self::COLOR_COLD,
26: self::COLOR_NORMAL,
27: self::COLOR_WARM,
28: ];
29: private const FORMAT_DEVICE = '-e \'{ "%s": [{ "%s": %s }] }\'';
ERROR: Unable to parse file: /code/src/Dto/CoapGatewayAuthConfigDto.php
ERROR: Parse error at line 16 column 7:
6: * Copyright (c) 2024 Benjamin Fahl
7: *
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Dto;
15:
16: final readonly class CoapGatewayAuthConfigDto
^
17: {
18: public function __construct(
19: private string $username,
20: #[\SensitiveParameter()]
21: private string $apiKey,
22: #[\SensitiveParameter()]
23: private string $gatewaySecret,
24: private string $gatewayIp,
25: ) {
26: $this->checkIp($this->gatewayIp);
ERROR: Unable to parse file: /code/src/Device/MotionSensor.php
ERROR: Parse error at line 28 column 9:
18: final class MotionSensor extends Device
19: {
20: /**
21: * @throws \IKEA\Tradfri\Exception\RuntimeException
22: */
23: public function __construct(int $deviceId)
24: {
25: parent::__construct(
26: $deviceId,
27: Keys::ATTR_DEVICE_INFO_TYPE_MOTION_SENSOR,
28: );
^
29: }
30: }
31:
ERROR: Unable to parse file: /code/src/Device/Driver.php
ERROR: Parse error at line 28 column 9:
18: final class Driver extends Device
19: {
20: /**
21: * @throws \IKEA\Tradfri\Exception\RuntimeException
22: */
23: public function __construct(int $deviceId)
24: {
25: parent::__construct(
26: $deviceId,
27: Keys::ATTR_DEVICE_INFO_TYPE_DRIVER_30W,
28: );
^
29: }
30: }
31:
ERROR: Unable to parse file: /code/src/Device/UnknownDevice.php
ERROR: Parse error at line 26 column 9:
16: final class UnknownDevice extends Device
17: {
18: /**
19: * @throws \IKEA\Tradfri\Exception\RuntimeException
20: */
21: public function __construct(int $deviceId, string $type)
22: {
23: parent::__construct(
24: $deviceId,
25: 'unknown' . $type,
26: );
^
27: }
28: }
29:
ERROR: Unable to parse file: /code/src/Device/ControlOutlet.php
ERROR: Parse error at line 28 column 9:
18: final class ControlOutlet extends Device
19: {
20: /**
21: * @throws \IKEA\Tradfri\Exception\RuntimeException
22: */
23: public function __construct(int $deviceId)
24: {
25: parent::__construct(
26: $deviceId,
27: Keys::ATTR_DEVICE_INFO_TYPE_CONTROL_OUTLET,
28: );
^
29: }
30: }
31:
ERROR: Unable to parse file: /code/src/Device/Remote.php
ERROR: Parse error at line 28 column 9:
18: final class Remote extends Device
19: {
20: /**
21: * @throws \IKEA\Tradfri\Exception\RuntimeException
22: */
23: public function __construct(int $deviceId)
24: {
25: parent::__construct(
26: $deviceId,
27: Keys::ATTR_DEVICE_INFO_TYPE_REMOTE_CONTROL,
28: );
^
29: }
30: }
31:
ERROR: Unable to parse file: /code/src/Device/Feature/BrightnessStateInterface.php
ERROR: Parse error at line 25 column 45:
15:
16: use IKEA\Tradfri\Exception\RuntimeException;
17:
18: interface BrightnessStateInterface
19: {
20: /**
21: * @throws RuntimeException
22: */
23: public function dim(int $levelInPercent): bool;
24:
25: public function setBrightnessLevel(float|int $levelInPercent): void;
^
26:
27: public function setBrightness(int $brightness): void;
28:
29: public function getBrightness(): float;
30: }
31:
ERROR: Unable to parse file: /code/src/Device/Helper/Type.php
ERROR: Parse error at line 34 column 18:
24: use IKEA\Tradfri\Device\Remote;
25: use IKEA\Tradfri\Device\Repeater;
26: use IKEA\Tradfri\Device\RollerBlind;
27: use IKEA\Tradfri\Exception\RuntimeException;
28:
29: /**
30: * todo: enum.
31: */
32: final class Type
33: {
34: final public const BLUB = 'TRADFRI bulb';
^
35: final public const BLUB_CLASS = LightBulb::class;
36: final public const MOTION_SENSOR = 'TRADFRI motion sensor';
37: final public const MOTION_SENSOR_CLASS = MotionSensor::class;
38: final public const REMOTE = 'TRADFRI remote control';
39: final public const REMOTE_CLASS = Remote::class;
40: final public const DIMMER = 'TRADFRI dimmer';
41: final public const DIMMER_CLASS = Dimmer::class;
42: final public const DRIVER = 'TRADFRI Driver ';
43: final public const DRIVER_CLASS = Driver::class;
44: final public const FLOALT = 'FLOALT panel ';
ERROR: Unable to parse file: /code/src/Collection/LightBulbs.php
ERROR: Parse error at line 34 column 20:
24: */
25: final class LightBulbs extends Devices
26: {
27: public function sortByState(): self
28: {
29: $items = $this->toArray();
30:
31: \usort(
32: $items,
33: /** @phpstan-ignore-next-line */
34: static fn (LightBulb $lightBulbOne, LightBulb $lightBulbTwo) => \strcmp(
^
35: $lightBulbOne->getReadableState(),
36: $lightBulbTwo->getReadableState(),
37: ),
38: );
39:
40: return $this->createFrom($items);
41: }
42:
43: public function getActive(): self
44: {
ERROR: Unable to parse file: /code/src/Client/Client.php
ERROR: Parse error at line 29 column 33:
19: use IKEA\Tradfri\Device\LightBulb;
20: use IKEA\Tradfri\Device\RollerBlind;
21: use IKEA\Tradfri\Group\LightGroup as Group;
22: use IKEA\Tradfri\Service\ServiceInterface;
23:
24: /**
25: * @phpstan-type LevelType = int<0,100>
26: */
27: final class Client implements ClientInterface
28: {
29: public function __construct(protected AdapterInterface $adapter)
^
30: {
31: }
32:
33: public function getDevices(ServiceInterface $service): Devices
34: {
35: return $this->adapter->getDeviceCollection($service);
36: }
37:
38: public function getGroups(ServiceInterface $service): Groups
39: {
ERROR: Unable to parse file: /code/src/Factory/GatewayServiceFactory.php
ERROR: Parse error at line 21 column 7:
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Factory;
15:
16: use IKEA\Tradfri\Adapter\CoapAdapter as Adapter;
17: use IKEA\Tradfri\Command\GatewayHelperCommands;
18: use IKEA\Tradfri\Dto\CoapGatewayAuthConfigDto;
19: use IKEA\Tradfri\Service\ServiceInterface;
20:
21: final readonly class GatewayServiceFactory
^
22: {
23: public function __construct(
24: private CoapGatewayAuthConfigDto $authConfig,
25: ) {
26: }
27:
28: public function __invoke(): ServiceInterface
29: {
30: return new \IKEA\Tradfri\Service\GatewayApiService(
31: client: new \IKEA\Tradfri\Client\Client(
ERROR: Unable to parse file: /code/src/Values/CoapCommandPattern.php
ERROR: Parse error at line 16 column 6:
6: * Copyright (c) 2024 Benjamin Fahl
7: *
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Values;
15:
16: enum CoapCommandPattern: string
^
17: {
18: case PUT = 'coap-client -m put -u "%s" -k "%s"';
19: case GET = 'coap-client -m get -u "%s" -k "%s"';
20: case POST = 'coap-client -m post -u "%s" -k "%s"';
21: }
22:
ERROR: Unable to parse file: /code/src/Traits/ProvidesColor.php
ERROR: Parse error at line 18 column 15:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: trait ProvidesColor
17: {
18: protected string $color = '';
^
19:
20: public function getColor(): string
21: {
22: return \mb_strtoupper($this->color);
23: }
24:
25: public function setColor(string $color): self
26: {
27: $this->color = $color;
28:
ERROR: Unable to parse file: /code/src/Traits/ProvidesName.php
ERROR: Parse error at line 18 column 15:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: trait ProvidesName
17: {
18: protected string $name;
^
19:
20: public function getName(): string
21: {
22: return $this->name;
23: }
24:
25: public function setName(string $name): self
26: {
27: $this->name = $name;
28:
ERROR: Unable to parse file: /code/src/Traits/ProvidesManufacturer.php
ERROR: Parse error at line 18 column 15:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: trait ProvidesManufacturer
17: {
18: protected string $manufacturer;
^
19:
20: public function getManufacturer(): string
21: {
22: return $this->manufacturer;
23: }
24:
25: public function setManufacturer(string $manufacturer): self
26: {
27: $this->manufacturer = $manufacturer;
28:
ERROR: Unable to parse file: /code/src/Traits/ProvidesId.php
ERROR: Parse error at line 18 column 15:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: trait ProvidesId
17: {
18: protected int $id;
^
19:
20: public function getId(): int
21: {
22: return $this->id;
23: }
24:
25: public function setId(int $id): self
26: {
27: $this->id = $id;
28:
ERROR: Unable to parse file: /code/src/Traits/ProvidesType.php
ERROR: Parse error at line 20 column 15:
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: use IKEA\Tradfri\Device\Helper\Type;
17:
18: trait ProvidesType
19: {
20: protected string $type;
^
21:
22: public function getType(): string
23: {
24: return $this->type;
25: }
26:
27: public function setType(string $type): self
28: {
29: $this->type = $type;
30:
ERROR: Unable to parse file: /code/src/Traits/ProvidesService.php
ERROR: Parse error at line 20 column 15:
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: use IKEA\Tradfri\Service\ServiceInterface;
17:
18: trait ProvidesService
19: {
20: protected ?ServiceInterface $service = null;
^
21:
22: public function getService(): ServiceInterface
23: {
24: if (!$this->hasService()) {
25: throw new \RuntimeException('Service missing');
26: }
27:
28: return $this->service;
29: }
30:
ERROR: Unable to parse file: /code/src/Traits/ProvidesVersion.php
ERROR: Parse error at line 18 column 15:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: trait ProvidesVersion
17: {
18: protected string $version;
^
19:
20: /**
21: * Get Version.
22: */
23: public function getVersion(): string
24: {
25: return $this->version;
26: }
27:
28: public function setVersion(string $name): self
ERROR: Unable to parse file: /code/src/Traits/ProvidesDarkenedState.php
ERROR: Parse error at line 18 column 15:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: trait ProvidesDarkenedState
17: {
18: protected int $darkenedState = 0;
^
19:
20: public function setDarkenedState(int $state): self
21: {
22: $this->darkenedState = \max(0, $state);
23:
24: return $this;
25: }
26:
27: public function getDarkenedState(): int
28: {
ERROR: Unable to parse file: /code/src/Traits/ProvidesState.php
ERROR: Parse error at line 18 column 15:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: trait ProvidesState
17: {
18: protected bool $state = false;
^
19:
20: public function setState(bool $state): self
21: {
22: $this->state = $state;
23:
24: return $this;
25: }
26:
27: public function getReadableState(): string
28: {
ERROR: Unable to parse file: /code/src/Traits/ProvidesBrightness.php
ERROR: Parse error at line 18 column 15:
8: * For the full copyright and license information, please view
9: * the LICENSE.md file that was distributed with this source code.
10: *
11: * @see https://github.com/WebProject-xyz/ikea-tradfri-php
12: */
13:
14: namespace IKEA\Tradfri\Traits;
15:
16: trait ProvidesBrightness
17: {
18: protected float $brightness = 0;
^
19:
20: public function setBrightnessLevel(float|int $levelInPercent): void
21: {
22: $this->brightness = (int) \round($levelInPercent);
23: }
24:
25: public function getBrightness(): float
26: {
27: return $this->brightness;
28: }
ERROR: Unable to parse file: /code/src/Helper/CommandRunnerInterface.php
ERROR: Parse error at line 26 column 114:
16: interface CommandRunnerInterface
17: {
18: /**
19: * Execute a command and return it's output. Either wait
20: * until the command exits or the timeout has expired.
21: * Found at @see https://stackoverflow.com/a/20992213/3578430.
22: *
23: * @param string $cmd command to execute
24: * @param int $timeout timeout in seconds
25: */
26: public function execWithTimeout(string $cmd, int $timeout, ?bool $asArray = null, bool $throw = false): array|string;
^
27: }
28:
ERROR: Unable to parse file: /code/src/Helper/CommandRunner.php
ERROR: Parse error at line 37 column 5:
27: * Found at @see https://stackoverflow.com/a/20992213/3578430.
28: *
29: * @param string $cmd command to execute
30: * @param int $timeout timeout in seconds
31: */
32: public function execWithTimeout(
33: string $cmd,
34: int $timeout,
35: ?bool $asArray = null,
36: bool $throw = false,
37: ): array|string {
^
38: $process = Process::fromShellCommandline(command: $cmd, timeout: $timeout);
39: $process->run();
40:
41: if (!$process->isSuccessful()) {
42: return $this->_parseErrors($throw, $process->getErrorOutput());
43: }
44:
45: $output = $process->getOutput();
46:
47: return $asArray
ERROR: Unable to parse file: /code/rector.php
ERROR: Parse error at line 25 column 14:
15: use Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector;
16:
17: return RectorConfig::configure()
18: ->withPaths([
19: __DIR__ . '/src',
20: __DIR__ . '/tests',
21: __DIR__ . '/wiki',
22: ])
23: // uncomment to reach your current PHP version
24: ->withPhpSets(
25: php82: true,
^
26: )
27: ->withSets([
28: Rector\Symfony\Set\SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
29: Rector\Symfony\Set\SymfonySetList::SYMFONY_64,
30: Rector\Symfony\Set\SymfonySetList::SYMFONY_CODE_QUALITY,
31: Rector\Symfony\Set\SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION,
32:
33: Rector\Doctrine\Set\DoctrineSetList::DOCTRINE_CODE_QUALITY,
34: ])
35: ->withRules([
INFO: 81/81 source files have been analyzed
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.839s
INFO: Final Memory: 13M/95M
INFO: ------------------------------------------------------------------------
|