diff --git a/lib/LongitudeOne/Core/Enum/AxisEnum.php b/lib/LongitudeOne/Core/Enum/AxisEnum.php index ead644a..3cbbf1d 100644 --- a/lib/LongitudeOne/Core/Enum/AxisEnum.php +++ b/lib/LongitudeOne/Core/Enum/AxisEnum.php @@ -11,15 +11,6 @@ declare(strict_types=1); -/** - * This file is part of the LongitudeOne GeoParser project. - * - * PHP 8.3 | 8.4 | 8.5 - * - * Copyright LongitudeOne - Alexandre Tranchant - Derek J. Lambert. - * Copyright 2024-2026. - */ - namespace LongitudeOne\Core\Enum; /** diff --git a/lib/LongitudeOne/Core/Exception/ExceptionInterface.php b/lib/LongitudeOne/Core/Exception/ExceptionInterface.php index 4361d03..0670c11 100644 --- a/lib/LongitudeOne/Core/Exception/ExceptionInterface.php +++ b/lib/LongitudeOne/Core/Exception/ExceptionInterface.php @@ -11,15 +11,6 @@ declare(strict_types=1); -/** - * This file is part of the LongitudeOne GeoParser project. - * - * PHP 8.3 | 8.4 | 8.5 - * - * Copyright LongitudeOne - Alexandre Tranchant - Derek J. Lambert. - * Copyright 2024-2026. - */ - namespace LongitudeOne\Core\Exception; /** diff --git a/lib/LongitudeOne/Core/Exception/RangeException.php b/lib/LongitudeOne/Core/Exception/RangeException.php index 810044b..f82b1a2 100644 --- a/lib/LongitudeOne/Core/Exception/RangeException.php +++ b/lib/LongitudeOne/Core/Exception/RangeException.php @@ -11,15 +11,6 @@ declare(strict_types=1); -/** - * This file is part of the LongitudeOne GeoParser project. - * - * PHP 8.3 | 8.4 | 8.5 - * - * Copyright LongitudeOne - Alexandre Tranchant - Derek J. Lambert. - * Copyright 2024-2026. - */ - namespace LongitudeOne\Core\Exception; use LongitudeOne\Core\Diagnostic\DiagnosticValueFormatter; diff --git a/tests/LongitudeOne/Core/Tests/Contract/Diagnostic/DiagnosticValueFormatterContractTest.php b/tests/LongitudeOne/Core/Tests/Contract/Diagnostic/DiagnosticValueFormatterContractTest.php index 6b24014..2392345 100644 --- a/tests/LongitudeOne/Core/Tests/Contract/Diagnostic/DiagnosticValueFormatterContractTest.php +++ b/tests/LongitudeOne/Core/Tests/Contract/Diagnostic/DiagnosticValueFormatterContractTest.php @@ -110,10 +110,10 @@ public function testFormattingIsIdempotent(): void */ public function testHostileCombinedInputRespectsEveryProtection(): void { - $value = str_repeat("POINT(1 2)\n\x1B[2J\u{202E}", self::MAX_EXPECTED_LENGTH); + $value = str_repeat("POINT(1 2)\xC3\n\x1B[2J\u{202E}", self::MAX_EXPECTED_LENGTH); $result = DiagnosticValueFormatter::format($value); - self::assertStringContainsString('POINT(1 2)\n\u{001B}[2J\u{202E}', $result); + self::assertStringContainsString('POINT(1 2)\xC3\n\u{001B}[2J\u{202E}', $result); self::assertStringNotContainsString("\x1B", $result); self::assertStringEndsWith('…', $result); $this->assertDiagnosticInvariants($result); diff --git a/tests/LongitudeOne/Core/Tests/Unit/Diagnostic/DiagnosticValueFormatterTest.php b/tests/LongitudeOne/Core/Tests/Unit/Diagnostic/DiagnosticValueFormatterTest.php index d5c8e91..44d2e7a 100644 --- a/tests/LongitudeOne/Core/Tests/Unit/Diagnostic/DiagnosticValueFormatterTest.php +++ b/tests/LongitudeOne/Core/Tests/Unit/Diagnostic/DiagnosticValueFormatterTest.php @@ -90,5 +90,7 @@ public static function oversizedValues(): iterable yield 'plain characters' => [str_repeat('a', DiagnosticValueFormatter::MAX_LENGTH + 1)]; yield 'expanding newlines' => [str_repeat("\n", DiagnosticValueFormatter::MAX_LENGTH)]; + + yield 'malformed UTF-8 bytes' => [str_repeat("\xFF", DiagnosticValueFormatter::MAX_LENGTH)]; } }