From 6ce511130eab49f765e636f310388e6707d72d5b Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 6 Mar 2026 19:37:44 +0100 Subject: [PATCH 1/4] one --- src/PelEntryByte.php | 2 +- src/PelJpegMarker.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PelEntryByte.php b/src/PelEntryByte.php index a7ec96b3..b851983a 100644 --- a/src/PelEntryByte.php +++ b/src/PelEntryByte.php @@ -44,6 +44,6 @@ public function __construct(int $tag, int ...$value) */ public function numberToBytes(int $number, bool $order): string { - return chr($number); + return chr($number & 0xFF); } } diff --git a/src/PelJpegMarker.php b/src/PelJpegMarker.php index 28d8e4ab..58168ae8 100644 --- a/src/PelJpegMarker.php +++ b/src/PelJpegMarker.php @@ -461,7 +461,7 @@ public static function isValid(int $marker): bool */ public static function getBytes(int $marker): string { - return chr($marker); + return chr($marker & 0xFF); } /** From b1d5e29c1a2b38e4495e7141371a222debd6a9b3 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 6 Mar 2026 19:43:45 +0100 Subject: [PATCH 2/4] two --- src/PelConvert.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/PelConvert.php b/src/PelConvert.php index 79cb2428..717d957e 100644 --- a/src/PelConvert.php +++ b/src/PelConvert.php @@ -106,9 +106,17 @@ public static function longToBytes(int $value, bool $endian): string */ $hex = str_pad(base_convert((string) $value, 10, 16), 8, '0', STR_PAD_LEFT); if ($endian === self::LITTLE_ENDIAN) { - return chr((int) hexdec($hex[6] . $hex[7])) . chr((int) hexdec($hex[4] . $hex[5])) . chr((int) hexdec($hex[2] . $hex[3])) . chr((int) hexdec($hex[0] . $hex[1])); + return + chr(((int) hexdec($hex[6] . $hex[7])) & 0xFF) . + chr(((int) hexdec($hex[4] . $hex[5])) & 0xFF) . + chr(((int) hexdec($hex[2] . $hex[3])) & 0xFF) . + chr(((int) hexdec($hex[0] . $hex[1])) & 0xFF); } - return chr((int) hexdec($hex[0] . $hex[1])) . chr((int) hexdec($hex[2] . $hex[3])) . chr((int) hexdec($hex[4] . $hex[5])) . chr((int) hexdec($hex[6] . $hex[7])); + return + chr(((int) hexdec($hex[0] . $hex[1])) & 0xFF) . + chr(((int) hexdec($hex[2] . $hex[3])) & 0xFF) . + chr(((int) hexdec($hex[4] . $hex[5])) & 0xFF) . + chr(((int) hexdec($hex[6] . $hex[7])) & 0xFF); } /** From 956ff32999d62ff9e0bb9bd883afecd0f6de9bd8 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 6 Mar 2026 19:47:05 +0100 Subject: [PATCH 3/4] three --- .github/workflows/tests.yml | 4 ++-- composer.json | 2 +- src/PelConvert.php | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 594feffa..6207da1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,8 +45,8 @@ jobs: - name: PHPStan code analysis run: php vendor/bin/phpstan analyze - - name: PHPinsights code analysis - run: php vendor/bin/phpinsights analyse --no-interaction +# - name: PHPinsights code analysis +# run: php vendor/bin/phpinsights analyse --no-interaction # - name: Execute Rector # continue-on-error: true diff --git a/composer.json b/composer.json index 5cf7f5de..1af7ec77 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "ext-gd" : "*", "ext-exif" : "*", "squizlabs/php_codesniffer" : ">=3.7", - "phpunit/phpunit" : "^10 || ^11 || ^12", + "phpunit/phpunit" : "^10 || ^11 || ^12 || ^13", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^2", "phpstan/phpstan-phpunit": "^2", diff --git a/src/PelConvert.php b/src/PelConvert.php index 717d957e..11ef10ea 100644 --- a/src/PelConvert.php +++ b/src/PelConvert.php @@ -106,14 +106,12 @@ public static function longToBytes(int $value, bool $endian): string */ $hex = str_pad(base_convert((string) $value, 10, 16), 8, '0', STR_PAD_LEFT); if ($endian === self::LITTLE_ENDIAN) { - return - chr(((int) hexdec($hex[6] . $hex[7])) & 0xFF) . + return chr(((int) hexdec($hex[6] . $hex[7])) & 0xFF) . chr(((int) hexdec($hex[4] . $hex[5])) & 0xFF) . chr(((int) hexdec($hex[2] . $hex[3])) & 0xFF) . chr(((int) hexdec($hex[0] . $hex[1])) & 0xFF); } - return - chr(((int) hexdec($hex[0] . $hex[1])) & 0xFF) . + return chr(((int) hexdec($hex[0] . $hex[1])) & 0xFF) . chr(((int) hexdec($hex[2] . $hex[3])) & 0xFF) . chr(((int) hexdec($hex[4] . $hex[5])) & 0xFF) . chr(((int) hexdec($hex[6] . $hex[7])) & 0xFF); From 8c834ff43f769fd82d58875bacc1eed9ac623bc8 Mon Sep 17 00:00:00 2001 From: mondrake Date: Fri, 6 Mar 2026 20:02:35 +0100 Subject: [PATCH 4/4] composer --- composer.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 1af7ec77..d85066e0 100644 --- a/composer.json +++ b/composer.json @@ -30,9 +30,7 @@ "phpunit/phpunit" : "^10 || ^11 || ^12 || ^13", "phpstan/extension-installer": "^1.4", "phpstan/phpstan": "^2", - "phpstan/phpstan-phpunit": "^2", - "rector/rector": "^2", - "nunomaduro/phpinsights": "^2" + "phpstan/phpstan-phpunit": "^2" }, "config": { "allow-plugins": {