From e0013d757b6c9f9ab32491a334781b6cf6e27aaa Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Mon, 1 Apr 2024 18:25:51 +0200 Subject: [PATCH] Fixup --- .github/workflows/main.yml | 2 +- psalm.xml | 1 - src/FileId.php | 5 +++-- src/Tools.php | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5f46576..786a72b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -44,6 +44,6 @@ jobs: TOKEN: ${{ secrets.TOKEN }} DEST: ${{ secrets.DEST }} run: | - vendor/bin/psalm --no-cache + vendor/bin/psalm --no-cache --shepherd vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml vendor/bin/php-cs-fixer --diff --dry-run -v fix diff --git a/psalm.xml b/psalm.xml index 9557c57..8ecbfb5 100644 --- a/psalm.xml +++ b/psalm.xml @@ -11,7 +11,6 @@ > - diff --git a/src/FileId.php b/src/FileId.php index 16d2091..c367d1b 100644 --- a/src/FileId.php +++ b/src/FileId.php @@ -159,8 +159,9 @@ final class FileId $local_id = Tools::unpackInt($read(4)); } - /** @psalm-suppress MixedArgument */ - $photosize_source = PhotoSizeSourceType::from($subVersion >= 4 ? \unpack('V', $read(4))[1] : 0); + /** @var int */ + $arg = $subVersion >= 4 ? \unpack('V', $read(4))[1] : 0; + $photosize_source = PhotoSizeSourceType::from($arg); switch ($photosize_source) { case PhotoSizeSourceType::LEGACY: $photoSizeSource = new PhotoSizeSourceLegacy(Tools::unpackLong($read(8))); diff --git a/src/Tools.php b/src/Tools.php index eb59738..4e1a85a 100644 --- a/src/Tools.php +++ b/src/Tools.php @@ -19,7 +19,7 @@ final class Tools */ public static function unpackLong(string $field): int { - /** @psalm-suppress MixedReturnStatement */ + /** @var int */ return \unpack('q', BIG_ENDIAN ? \strrev($field) : $field)[1]; } /** @@ -30,7 +30,7 @@ final class Tools */ public static function unpackInt(string $field): int { - /** @psalm-suppress MixedReturnStatement */ + /** @var int */ return \unpack('l', $field)[1]; } /**