12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
W, [2024-05-05T10:44:39.821250 #1] WARN -- : Skipping src/Service/GatewayApiService.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.821303 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.824212 #1] WARN -- : Skipping src/Service/ServiceInterface.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.824242 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.831895 #1] WARN -- : Skipping src/Serializer/Normalizer/ArrayNestingNormalizer.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.831921 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.834297 #1] WARN -- : Skipping src/Serializer/JsonDeviceDataSerializer.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.834323 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.836264 #1] WARN -- : Skipping src/Command/Put.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.836289 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.838202 #1] WARN -- : Skipping src/Command/AbstractCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.838229 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.840131 #1] WARN -- : Skipping src/Command/Post.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.840156 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.842242 #1] WARN -- : Skipping src/Command/GatewayHelperCommands.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.842268 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.852511 #1] WARN -- : Skipping src/Command/Coap/Group/GroupSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.852543 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.855224 #1] WARN -- : Skipping src/Command/Coap/Group/GroupDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.855248 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.859182 #1] WARN -- : Skipping src/Command/Coap/Keys.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.859207 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.861691 #1] WARN -- : Skipping src/Command/Coap/Receiver.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.861715 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.864933 #1] WARN -- : Skipping src/Command/Coap/Light/LightSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.864963 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.867321 #1] WARN -- : Skipping src/Command/Coap/Light/LightDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.867348 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.869464 #1] WARN -- : Skipping src/Command/Coap/Light/LightChangeLightTemperatureCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.870957 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.872821 #1] WARN -- : Skipping src/Command/Coap/Blinds/BlindsGetCurrentPositionCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.872845 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.876725 #1] WARN -- : Skipping src/Command/Get.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.876748 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.907288 #1] WARN -- : Skipping src/Adapter/CoapAdapter.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.907312 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.945575 #1] WARN -- : Skipping src/Dto/CoapResponse/DeviceDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.945601 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.947307 #1] WARN -- : Skipping src/Dto/CoapResponse/BlindControlDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.947338 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.949269 #1] WARN -- : Skipping src/Dto/CoapResponse/LightControlDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.949298 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.950990 #1] WARN -- : Skipping src/Dto/CoapResponse/DeviceInfoDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.951015 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.952742 #1] WARN -- : Skipping src/Dto/CoapResponse/GroupDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.952767 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.954703 #1] WARN -- : Skipping src/Dto/CoapGatewayRequestPayloadDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.954729 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.956506 #1] WARN -- : Skipping src/Dto/CoapGatewayAuthConfigDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.956531 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:39.998630 #1] WARN -- : Skipping src/Device/Helper/Type.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:39.998655 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:40.025808 #1] WARN -- : Skipping src/Factory/GatewayServiceFactory.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:40.025834 #1] WARN -- : Response status: 422
|
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
W, [2024-05-05T10:44:43.329889 #1] WARN -- : Skipping ./src/Service/ServiceInterface.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.329943 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.333147 #1] WARN -- : Skipping ./src/Service/GatewayApiService.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.333186 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.339340 #1] WARN -- : Skipping ./src/Serializer/Normalizer/ArrayNestingNormalizer.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.339620 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.342694 #1] WARN -- : Skipping ./src/Serializer/JsonDeviceDataSerializer.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.342731 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.346182 #1] WARN -- : Skipping ./src/Command/Put.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.346269 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.346241 #1] WARN -- : Skipping ./src/Command/AbstractCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.346361 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.348621 #1] WARN -- : Skipping ./src/Command/Post.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.348648 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.350253 #1] WARN -- : Skipping ./src/Command/GatewayHelperCommands.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.350279 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.353292 #1] WARN -- : Skipping ./src/Command/Coap/Group/GroupSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.353318 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.355480 #1] WARN -- : Skipping ./src/Command/Coap/Group/GroupDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.355507 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.360040 #1] WARN -- : Skipping ./src/Command/Coap/Keys.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.360071 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.361977 #1] WARN -- : Skipping ./src/Command/Coap/Receiver.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.362005 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.363811 #1] WARN -- : Skipping ./src/Command/Coap/Light/LightSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.363838 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.365819 #1] WARN -- : Skipping ./src/Command/Coap/Light/LightDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.365844 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.367864 #1] WARN -- : Skipping ./src/Command/Coap/Light/LightChangeLightTemperatureCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.367890 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.369508 #1] WARN -- : Skipping ./src/Command/Coap/Blinds/BlindsGetCurrentPositionCommand.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.369533 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.373131 #1] WARN -- : Skipping ./src/Command/Get.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.373158 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.406784 #1] WARN -- : Skipping ./src/Adapter/CoapAdapter.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.406855 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.437630 #1] WARN -- : Skipping ./src/Dto/CoapResponse/DeviceDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.447787 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.450264 #1] WARN -- : Skipping ./src/Dto/CoapResponse/BlindControlDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.450302 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.451552 #1] WARN -- : Skipping ./src/Dto/CoapResponse/LightControlDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.451582 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.452609 #1] WARN -- : Skipping ./src/Dto/CoapResponse/DeviceInfoDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.452643 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.453711 #1] WARN -- : Skipping ./src/Dto/CoapResponse/GroupDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.453742 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.454985 #1] WARN -- : Skipping ./src/Dto/CoapGatewayRequestPayloadDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.455011 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.456058 #1] WARN -- : Skipping ./src/Dto/CoapGatewayAuthConfigDto.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.456083 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.487141 #1] WARN -- : Skipping ./src/Device/Helper/Type.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.487170 #1] WARN -- : Response status: 422
W, [2024-05-05T10:44:43.515609 #1] WARN -- : Skipping ./src/Factory/GatewayServiceFactory.php due to CC::Parser::Client::HTTPError
W, [2024-05-05T10:44:43.515647 #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: 99 files indexed
INFO: 80 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\Device;
22: use IKEA\Tradfri\Device\DeviceInterface;
23: use IKEA\Tradfri\Device\LightBulb;
24: use IKEA\Tradfri\Device\RollerBlind;
25: use IKEA\Tradfri\Device\SwitchableInterface;
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/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/JsonDeviceDataSerializer.php
ERROR: Parse error at line 28 column 18:
18: use Symfony\Component\Serializer\Encoder\JsonEncoder;
19: use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
20: use Symfony\Component\Serializer\Mapping\Loader\AttributeLoader;
21: use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter;
22: use Symfony\Component\Serializer\Normalizer\AbstractObjectNormalizer;
23: use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
24: use Symfony\Component\Serializer\Serializer;
25:
26: final class JsonDeviceDataSerializer implements \Symfony\Component\Serializer\SerializerInterface
27: {
28: final public const FORMAT = JsonEncoder::FORMAT;
^
29: private Serializer $serializer;
30:
31: public function __construct()
32: {
33: $this->initSerializer();
34: }
35:
36: public function deserialize(mixed $data, string $type, string $format, array $context = []): array|DeviceDto
37: {
38: 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 33 column 15:
23: use IKEA\Tradfri\Traits\ProvidesState;
24:
25: /**
26: * @final
27: */
28: class DeviceGroup implements \JsonSerializable, BooleanStateInterface, DeviceInterface
29: {
30: use ProvidesId;
31: use ProvidesName;
32: use ProvidesState;
33: protected GatewayApiService|ServiceInterface $_service;
^
34: protected Devices $_devices;
35: protected array $_deviceIds = [];
36:
37: public function __construct(int $deviceId, ServiceInterface $service)
38: {
39: $this->setId($deviceId);
40: $this->setService($service);
41: }
42:
43: 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 43 column 5:
33:
34: /**
35: * @phpstan-param Groups $collection
36: *
37: * @phpstan-return Groups
38: */
39: public function map(
40: ServiceInterface $service,
41: iterable $dataItems,
42: AbstractCollection $collection,
43: ): AbstractCollection {
^
44: foreach ($dataItems as $device) {
45: if (false === $this->isValidData($device)) {
46: $this->logger?->warning('invalid device detected - skipped', ['device' => \serialize($device), 'type' => \get_debug_type($device)]);
47: continue;
48: }
49:
50: $group = new LightGroup(
51: (int) $device->{Keys::ATTR_ID},
52: $service,
53: );
ERROR: Unable to parse file: /code/src/Mapper/DeviceData.php
ERROR: Parse error at line 50 column 5:
40: *
41: * @phpstan-param Devices $collection
42: * @phpstan-param DeviceDto[] $dataItems
43: *
44: * @phpstan-return Devices
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 46 column 9:
36: use IKEA\Tradfri\Util\JsonIntTypeNormalizer;
37: use Psr\Log\LoggerAwareInterface;
38: use Psr\Log\LoggerAwareTrait;
39:
40: final class CoapAdapter implements AdapterInterface, LoggerAwareInterface
41: {
42: use LoggerAwareTrait;
43: private const COULD_NOT_SWITCH_STATE = 'Could not switch state';
44:
45: public function __construct(
46: private readonly CoapGatewayAuthConfigDto $authConfig,
^
47: private readonly GatewayHelperCommands $commands,
48: private readonly DeviceData $deviceDataMapper,
49: private readonly GroupData $groupDataMapper,
50: private readonly CommandRunnerInterface $runner = new CommandRunner(),
51: private readonly JsonDeviceDataSerializer $deviceSerializer = new JsonDeviceDataSerializer(),
52: ) {
53: }
54:
55: /**
56: * @throws \JsonException|RuntimeException
ERROR: Unable to parse file: /code/src/Validator/Group/Data.php
ERROR: Parse error at line 26 column 20:
16: use IKEA\Tradfri\Command\Coap\Keys;
17: use IKEA\Tradfri\Exception\RuntimeException;
18: use IKEA\Tradfri\Exception\TypeException;
19: use IKEA\Tradfri\Validator\ValidatorInterface;
20:
21: final class Data implements ValidatorInterface
22: {
23: /**
24: * @var list<string>
25: */
26: private static array $mustHaves = [
^
27: Keys::ATTR_ID,
28: Keys::ATTR_NAME,
29: Keys::ATTR_GROUP_MEMBERS,
30: ];
31:
32: /**
33: * @throws RuntimeException
34: */
35: public function isValid(mixed $data): bool
36: {
ERROR: Unable to parse file: /code/src/Validator/Device/Data.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 function __construct(
22: #[SerializedName(serializedName: 'ATTR_ID')]
23: #[Assert\NotBlank()]
24: private int $id,
25: #[SerializedName(serializedName: 'ATTR_NAME')]
26: #[Assert\NotBlank()]
27: private ?string $name,
28: ) {
29: }
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/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/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/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: 80/80 source files have been analyzed
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 0.479s
INFO: Final Memory: 11M/95M
INFO: ------------------------------------------------------------------------
|