diff --git a/composer.json b/composer.json index a164ad7..f00efdc 100755 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "symfony/yaml": "^7.0", "symfony/validator": "^7.0", "phpstan/phpstan-symfony": "^2", - "assoconnect/php-quality-config": "^2", + "assoconnect/php-quality-config": "^2.2", "symfony/security-core": "^7.0" }, "require": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 698933b..53c4ef5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,19 +1,19 @@ - + - - - ./src - - ./tests/ + + + ./src + + diff --git a/src/Serializer/LogSerializer.php b/src/Serializer/LogSerializer.php index 7071b82..0f5db0d 100755 --- a/src/Serializer/LogSerializer.php +++ b/src/Serializer/LogSerializer.php @@ -77,7 +77,7 @@ private function formatValue($value): mixed 'string' => mb_substr($value, 0, Log::MAX_STRING_LENGTH), 'NULL', 'boolean', 'double', 'integer' => $value, 'object' => $this->formatObject($value), - 'array' => array_map(__METHOD__, $value), + 'array' => array_map($this->formatValue(...), $value), 'resource', 'resource (closed)', 'unknown type' => throw new \InvalidArgumentException('Unhandled type'), }; diff --git a/tests/Functional/Entity/Address.php b/tests/Functional/Entity/Address.php index e5ea238..ab35594 100755 --- a/tests/Functional/Entity/Address.php +++ b/tests/Functional/Entity/Address.php @@ -20,4 +20,11 @@ public function getStreetName(): ?string { return $this->streetName; } + + public function setStreetName(?string $streetName): self + { + $this->streetName = $streetName; + + return $this; + } } diff --git a/tests/Serializer/LogSerializerTest.php b/tests/Serializer/LogSerializerTest.php index 45eff35..2caa74b 100755 --- a/tests/Serializer/LogSerializerTest.php +++ b/tests/Serializer/LogSerializerTest.php @@ -82,7 +82,7 @@ public function testFormatValueAsStringWorks($value, $formatted): void self::assertSame($formatted, $formatter->formatValueAsString($value)); } - public function providerFormatValueAsString(): iterable + public static function providerFormatValueAsString(): iterable { yield [null, 'null']; yield [[null], '[null]'];