Skip to content

Commit

Permalink
Fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Apr 1, 2024
1 parent 703568e commit e0013d7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
>
<projectFiles>
<directory name="src" />
<directory name="tests" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
Expand Down
5 changes: 3 additions & 2 deletions src/FileId.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ public static function fromBotAPI(string $fileId): self
$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)));
Expand Down
4 changes: 2 additions & 2 deletions src/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
/**
Expand All @@ -30,7 +30,7 @@ public static function unpackLong(string $field): int
*/
public static function unpackInt(string $field): int
{
/** @psalm-suppress MixedReturnStatement */
/** @var int */
return \unpack('l', $field)[1];
}
/**
Expand Down

0 comments on commit e0013d7

Please sign in to comment.