WebProject-xyz/ikea-tradfri-php

View on GitHub
Update shivammathur/setup-php action to v2.30.4 #1252
renovate[bot] authored 6725f9ff
complete00:00:27
1
git clone
2
codeclimate validate-config
View output
codeclimate validate-config
No errors or warnings found in .codeclimate.yml.
3
codeclimate prepare
View output
codeclimate prepare
4
builder pull-engines
View output
determining required images
docker pull codeclimate/codeclimate-phpmd:b291
b291: Pulling from codeclimate/codeclimate-phpmd
41dcc117e123: Pulling fs layer
e7cb8c1bd7da: Pulling fs layer
382dd9e936d2: Pulling fs layer
01d3fd4ccf07: Pulling fs layer
d54cbc0233c4: Pulling fs layer
a01b3d804127: Pulling fs layer
02aaff91dfc2: Pulling fs layer
25d9a4b72163: Pulling fs layer
01d3fd4ccf07: Waiting
378b764b6ee5: Pulling fs layer
d54cbc0233c4: Waiting
d8ae1ee899c7: Pulling fs layer
a01b3d804127: Waiting
f11257bedacf: Pulling fs layer
40adf26d4529: Pulling fs layer
02aaff91dfc2: Waiting
25d9a4b72163: Waiting
378b764b6ee5: Waiting
f11257bedacf: Waiting
d8ae1ee899c7: Waiting
e7cb8c1bd7da: Verifying Checksum
e7cb8c1bd7da: Download complete
382dd9e936d2: Verifying Checksum
382dd9e936d2: Download complete
41dcc117e123: Verifying Checksum
41dcc117e123: Download complete
01d3fd4ccf07: Verifying Checksum
01d3fd4ccf07: Download complete
41dcc117e123: Pull complete
a01b3d804127: Verifying Checksum
a01b3d804127: Download complete
25d9a4b72163: Verifying Checksum
25d9a4b72163: Download complete
e7cb8c1bd7da: Pull complete
02aaff91dfc2: Verifying Checksum
02aaff91dfc2: Download complete
382dd9e936d2: Pull complete
378b764b6ee5: Verifying Checksum
378b764b6ee5: Download complete
d8ae1ee899c7: Download complete
f11257bedacf: Verifying Checksum
f11257bedacf: Download complete
01d3fd4ccf07: Pull complete
40adf26d4529: Download complete
d54cbc0233c4: Pull complete
a01b3d804127: Pull complete
02aaff91dfc2: Pull complete
25d9a4b72163: Pull complete
378b764b6ee5: Pull complete
d8ae1ee899c7: Pull complete
f11257bedacf: Pull complete
40adf26d4529: Pull complete
Digest: sha256:100ad83154de1d7143edb4360753a5a3c2c35f8a0fd8f00352718003e2b63bfa
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-phpmd:b291
docker pull codeclimate/codeclimate-phpcodesniffer:b163
b163: Pulling from codeclimate/codeclimate-phpcodesniffer
a0710691c81a: Pulling fs layer
a3ed95caeb02: Pulling fs layer
f3c17b6c6935: Pulling fs layer
c3166a36a8d9: Pulling fs layer
83a051f0858f: Pulling fs layer
f0e9f15ec462: Pulling fs layer
034c114563b8: Pulling fs layer
5edc25e33d4e: Pulling fs layer
c3166a36a8d9: Waiting
83a051f0858f: Waiting
f0e9f15ec462: Waiting
034c114563b8: Waiting
5edc25e33d4e: Waiting
a3ed95caeb02: Download complete
a0710691c81a: Download complete
f3c17b6c6935: Verifying Checksum
f3c17b6c6935: Download complete
83a051f0858f: Verifying Checksum
83a051f0858f: Download complete
a0710691c81a: Pull complete
034c114563b8: Download complete
c3166a36a8d9: Verifying Checksum
c3166a36a8d9: Download complete
a3ed95caeb02: Pull complete
5edc25e33d4e: Download complete
f0e9f15ec462: Verifying Checksum
f0e9f15ec462: Download complete
f3c17b6c6935: Pull complete
c3166a36a8d9: Pull complete
83a051f0858f: Pull complete
f0e9f15ec462: Pull complete
034c114563b8: Pull complete
5edc25e33d4e: Pull complete
Digest: sha256:cab8fcc753b6ae0e309b899665b22b1b62c26c56dab9b3c6a938fa72ca7c0640
Status: Downloaded newer image for registry.prod.codeclimate.net/codeclimate/codeclimate-phpcodesniffer:b163
5
structure
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
W, [2024-04-24T06:47:20.483265 #1]  WARN -- : Skipping src/Service/GatewayApiService.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.483319 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.488464 #1]  WARN -- : Skipping src/Service/ServiceInterface.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.488505 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.504094 #1]  WARN -- : Skipping src/Serializer/Normalizer/ArrayNestingNormalizer.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.504124 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.507765 #1]  WARN -- : Skipping src/Serializer/JsonDeviceDataSerializer.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.507798 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.510683 #1]  WARN -- : Skipping src/Command/Put.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.510709 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.514137 #1]  WARN -- : Skipping src/Command/AbstractCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.514170 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.517089 #1]  WARN -- : Skipping src/Command/Post.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.517126 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.520228 #1]  WARN -- : Skipping src/Command/GatewayHelperCommands.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.520263 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.535948 #1]  WARN -- : Skipping src/Command/Coap/Group/GroupSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.535985 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.540877 #1]  WARN -- : Skipping src/Command/Coap/Group/GroupDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.540905 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.545650 #1]  WARN -- : Skipping src/Command/Coap/Keys.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.545676 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.548781 #1]  WARN -- : Skipping src/Command/Coap/Receiver.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.548808 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.551693 #1]  WARN -- : Skipping src/Command/Coap/Light/LightSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.551719 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.554658 #1]  WARN -- : Skipping src/Command/Coap/Light/LightDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.554687 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.558503 #1]  WARN -- : Skipping src/Command/Coap/Light/LightChangeLightTemperatureCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.558535 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.561930 #1]  WARN -- : Skipping src/Command/Coap/Blinds/BlindsGetCurrentPositionCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.561956 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.566846 #1]  WARN -- : Skipping src/Command/Get.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.566875 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.635204 #1]  WARN -- : Skipping src/Adapter/CoapAdapter.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.635250 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.733865 #1]  WARN -- : Skipping src/Dto/CoapResponse/DeviceDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.733906 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.738468 #1]  WARN -- : Skipping src/Dto/CoapResponse/BlindControlDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.738506 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.744995 #1]  WARN -- : Skipping src/Dto/CoapResponse/LightControlDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.745033 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.747625 #1]  WARN -- : Skipping src/Dto/CoapResponse/DeviceInfoDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.747663 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.749779 #1]  WARN -- : Skipping src/Dto/CoapResponse/GroupDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.749805 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.752587 #1]  WARN -- : Skipping src/Dto/CoapGatewayRequestPayloadDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.752615 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.756652 #1]  WARN -- : Skipping src/Dto/CoapGatewayAuthConfigDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.756713 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.847751 #1]  WARN -- : Skipping src/Device/Helper/Type.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.847789 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:20.892773 #1]  WARN -- : Skipping src/Factory/GatewayServiceFactory.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:20.892803 #1]  WARN -- : Response status: 422
6
duplication
View output
12
Parser process id: 12
codeclimate-parser socket not present
waiting 1s...
W, [2024-04-24T06:47:24.598658 #1]  WARN -- : Skipping ./src/Service/GatewayApiService.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.598720 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.600397 #1]  WARN -- : Skipping ./src/Service/ServiceInterface.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.600497 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.609259 #1]  WARN -- : Skipping ./src/Serializer/Normalizer/ArrayNestingNormalizer.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.609295 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.611345 #1]  WARN -- : Skipping ./src/Serializer/JsonDeviceDataSerializer.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.611449 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.615685 #1]  WARN -- : Skipping ./src/Command/AbstractCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.615762 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.616344 #1]  WARN -- : Skipping ./src/Command/Put.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.616397 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.620183 #1]  WARN -- : Skipping ./src/Command/Post.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.620399 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.621874 #1]  WARN -- : Skipping ./src/Command/GatewayHelperCommands.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.621912 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.626292 #1]  WARN -- : Skipping ./src/Command/Coap/Group/GroupSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.630816 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.628521 #1]  WARN -- : Skipping ./src/Command/Coap/Group/GroupDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.631070 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.634360 #1]  WARN -- : Skipping ./src/Command/Coap/Receiver.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.634468 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.638128 #1]  WARN -- : Skipping ./src/Command/Coap/Keys.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.638215 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.647883 #1]  WARN -- : Skipping ./src/Command/Coap/Light/LightSwitchStateCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.647947 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.649937 #1]  WARN -- : Skipping ./src/Command/Coap/Light/LightDimmerCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.649963 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.652259 #1]  WARN -- : Skipping ./src/Command/Coap/Light/LightChangeLightTemperatureCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.652292 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.655163 #1]  WARN -- : Skipping ./src/Command/Coap/Blinds/BlindsGetCurrentPositionCommand.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.655195 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.666752 #1]  WARN -- : Skipping ./src/Command/Get.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.666789 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.713004 #1]  WARN -- : Skipping ./src/Adapter/CoapAdapter.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.713046 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.815869 #1]  WARN -- : Skipping ./src/Dto/CoapResponse/DeviceDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.815907 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.822206 #1]  WARN -- : Skipping ./src/Dto/CoapResponse/BlindControlDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.822245 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.822968 #1]  WARN -- : Skipping ./src/Dto/CoapResponse/LightControlDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.823002 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.824944 #1]  WARN -- : Skipping ./src/Dto/CoapResponse/DeviceInfoDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.824978 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.826287 #1]  WARN -- : Skipping ./src/Dto/CoapResponse/GroupDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.826321 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.828063 #1]  WARN -- : Skipping ./src/Dto/CoapGatewayRequestPayloadDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.828096 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.830582 #1]  WARN -- : Skipping ./src/Dto/CoapGatewayAuthConfigDto.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.830615 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.919269 #1]  WARN -- : Skipping ./src/Device/Helper/Type.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.919665 #1]  WARN -- : Response status: 422
W, [2024-04-24T06:47:24.985758 #1]  WARN -- : Skipping ./src/Factory/GatewayServiceFactory.php due to CC::Parser::Client::HTTPError
W, [2024-04-24T06:47:24.985797 #1]  WARN -- : Response status: 422
7
phpmd
phpmd engine documentation
8
phpcodesniffer
phpcodesniffer engine documentation
9
sonar-php
sonar-php engine documentation
View output
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/Unknown.php
ERROR: Parse error at line 26 column 9:

16: final class Unknown 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:             'TRADFRI 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:         $deviceMapper = new \IKEA\Tradfri\Mapper\DeviceData();
31:         $groupMapper  = new \IKEA\Tradfri\Mapper\GroupData();

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 = $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: 1.086s
INFO: Final Memory: 10M/93M
INFO: ------------------------------------------------------------------------