Skip to content

Commit 4d497ba

Browse files
Add support for PHP 8.5
1 parent 2f4f946 commit 4d497ba

9 files changed

Lines changed: 15 additions & 56 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
matrix:
1010
operating-system: [ ubuntu-latest ]
11-
php-versions: [ '8.1', '8.2', '8.3', '8.4' ]
11+
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
1212
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
1313

1414
steps:

.scrutinizer.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2023 odan
3+
Copyright (c) 2026 odan
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Note: This package does not support extracting / unpacking rar archives.
1919

2020
## Requirements
2121

22-
* PHP 8.1 - 8.4
22+
* PHP 8.2 - 8.5
2323

2424
> The [PECL RAR package](https://www.php.net/manual/en/book.rar.php) is **NOT** required
2525

composer.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
],
1212
"homepage": "https://github.com/selective-php/rar",
1313
"require": {
14-
"php": "8.1.* || 8.2.* || 8.3.* || 8.4.*"
14+
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0"
1515
},
1616
"require-dev": {
1717
"friendsofphp/php-cs-fixer": "^3",
1818
"phpstan/phpstan": "^1 || ^2",
19-
"phpunit/phpunit": "^10",
19+
"phpunit/phpunit": "^11",
2020
"squizlabs/php_codesniffer": "^3"
2121
},
2222
"autoload": {
@@ -34,12 +34,10 @@
3434
},
3535
"scripts": {
3636
"cs:check": [
37-
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
38-
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi"
37+
"php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi --allow-unsupported-php-version=yes"
3938
],
4039
"cs:fix": [
41-
"@putenv PHP_CS_FIXER_IGNORE_ENV=1",
42-
"php-cs-fixer fix --config=.cs.php --ansi --verbose"
40+
"php-cs-fixer fix --config=.cs.php --ansi --verbose --allow-unsupported-php-version=yes"
4341
],
4442
"sniffer:check": "phpcs --standard=phpcs.xml",
4543
"sniffer:fix": "phpcbf --standard=phpcs.xml",

phpcs.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</rule>
2323
<rule ref="Generic.Metrics.NestingLevel">
2424
<properties>
25-
<property name="nestingLevel" value="2"/>
25+
<property name="nestingLevel" value="3"/>
2626
<property name="absoluteNestingLevel" value="4"/>
2727
</properties>
2828
</rule>

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
bootstrap="vendor/autoload.php"
44
colors="true"
55
backupGlobals="false"
6-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
6+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
77
cacheDirectory=".phpunit.cache"
88
backupStaticProperties="false">
99
<coverage/>

src/BinaryFileReader.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ public function readInt(SplFileObject $file): int
4040
*/
4141
public function readByte(SplFileObject $file): int
4242
{
43-
return ord((string)$file->fread(1));
43+
$data = (string)$file->fread(1);
44+
45+
return $data === '' ? 0 : ord($data);
4446
}
4547

4648
public function readVint(SplFileObject $file): int

tests/RarFileReaderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Selective\Rar\Test;
44

5+
use PHPUnit\Framework\Attributes\DataProvider;
56
use PHPUnit\Framework\TestCase;
67
use Selective\Rar\RarFileReader;
78
use SplFileObject;
@@ -71,12 +72,11 @@ public function testOpenFileRar5ChinaWindows(): void
7172
/**
7273
* Test.
7374
*
74-
* @dataProvider providerTestOpenFile2
75-
*
7675
* @param string $filename The filename
7776
*
7877
* @return void
7978
*/
79+
#[DataProvider('providerTestOpenFile2')]
8080
public function disabledTestOpenFile2(string $filename): void
8181
{
8282
$this->assertFileExists($filename);
@@ -183,9 +183,9 @@ public function testOpenFileRarWinRarMultiVolume0002(): void
183183
}
184184

185185
/**
186-
* @dataProvider providerTestOpenFileTestfile
187186
* @param string $filename
188187
*/
188+
#[DataProvider('providerTestOpenFileTestfile')]
189189
public function testOpenFileTestfile(string $filename): void
190190
{
191191
$this->assertFileExists($filename);

0 commit comments

Comments
 (0)