mirror of
https://github.com/danog/tg-file-decoder.git
synced 2024-11-26 12:24:40 +01:00
Fixup
This commit is contained in:
parent
703568e1e0
commit
e0013d757b
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -44,6 +44,6 @@ jobs:
|
|||||||
TOKEN: ${{ secrets.TOKEN }}
|
TOKEN: ${{ secrets.TOKEN }}
|
||||||
DEST: ${{ secrets.DEST }}
|
DEST: ${{ secrets.DEST }}
|
||||||
run: |
|
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/phpunit --coverage-text --coverage-clover build/logs/clover.xml
|
||||||
vendor/bin/php-cs-fixer --diff --dry-run -v fix
|
vendor/bin/php-cs-fixer --diff --dry-run -v fix
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
>
|
>
|
||||||
<projectFiles>
|
<projectFiles>
|
||||||
<directory name="src" />
|
<directory name="src" />
|
||||||
<directory name="tests" />
|
|
||||||
<ignoreFiles>
|
<ignoreFiles>
|
||||||
<directory name="vendor" />
|
<directory name="vendor" />
|
||||||
</ignoreFiles>
|
</ignoreFiles>
|
||||||
|
@ -159,8 +159,9 @@ final class FileId
|
|||||||
$local_id = Tools::unpackInt($read(4));
|
$local_id = Tools::unpackInt($read(4));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @psalm-suppress MixedArgument */
|
/** @var int */
|
||||||
$photosize_source = PhotoSizeSourceType::from($subVersion >= 4 ? \unpack('V', $read(4))[1] : 0);
|
$arg = $subVersion >= 4 ? \unpack('V', $read(4))[1] : 0;
|
||||||
|
$photosize_source = PhotoSizeSourceType::from($arg);
|
||||||
switch ($photosize_source) {
|
switch ($photosize_source) {
|
||||||
case PhotoSizeSourceType::LEGACY:
|
case PhotoSizeSourceType::LEGACY:
|
||||||
$photoSizeSource = new PhotoSizeSourceLegacy(Tools::unpackLong($read(8)));
|
$photoSizeSource = new PhotoSizeSourceLegacy(Tools::unpackLong($read(8)));
|
||||||
|
@ -19,7 +19,7 @@ final class Tools
|
|||||||
*/
|
*/
|
||||||
public static function unpackLong(string $field): int
|
public static function unpackLong(string $field): int
|
||||||
{
|
{
|
||||||
/** @psalm-suppress MixedReturnStatement */
|
/** @var int */
|
||||||
return \unpack('q', BIG_ENDIAN ? \strrev($field) : $field)[1];
|
return \unpack('q', BIG_ENDIAN ? \strrev($field) : $field)[1];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@ -30,7 +30,7 @@ final class Tools
|
|||||||
*/
|
*/
|
||||||
public static function unpackInt(string $field): int
|
public static function unpackInt(string $field): int
|
||||||
{
|
{
|
||||||
/** @psalm-suppress MixedReturnStatement */
|
/** @var int */
|
||||||
return \unpack('l', $field)[1];
|
return \unpack('l', $field)[1];
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user