Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
dependencies: ["lowest", "highest"]
php-version:
- "8.3"
- "8.4"

steps:
- name: "Checkout"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/code_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- uses: actions/checkout@v4
- uses: shivammathur/setup-php@master
with:
php-version: 8.3
php-version: 8.4
coverage: xdebug
- name: Load dependencies from cache
id: composer-cache
Expand All @@ -23,9 +23,9 @@ jobs:
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php8.3-composer-${{ hashFiles('**/composer.json') }}
key: ${{ runner.os }}-php8.4-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php8.3-composer-
${{ runner.os }}-php8.4-composer-

- run: composer install --prefer-dist --no-progress --no-suggest
- run: php vendor/bin/phpunit --coverage-clover build/logs/clover.xml
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"ext-mbstring": "*",
"ext-simplexml": "*",
"ext-tidy": "*",
"brainbits/phpcs-standard": "^7.0.1",
"brainbits/phpcs-standard": "^8.0.0",
"brainbits/phpstan-rules": "^4.0",
"dama/doctrine-test-bundle": "^8.2",
"doctrine/dbal": "^3.9",
"ergebnis/phpstan-rules": "^2.6",
"ergebnis/phpstan-rules": "^2.8",
"gemorroj/archive7z": "^5.7",
"mikey179/vfsstream": "^1.6.12",
"monolog/monolog": "^2.0 || ^3.0",
Expand Down
4 changes: 4 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ parameters:
- '#Constructor in .* has parameter .* with default value#'
- '#SchemaBuilder::foo\(\)#'
ergebnis:
noAssignByReference:
enabled: false
noParameterPassedByReference:
enabled: false
noNullableReturnTypeDeclaration:
enabled: false
noParameterWithNullableTypeDeclaration:
Expand Down
3 changes: 2 additions & 1 deletion src/HttpClientMock/HttpClientMockTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
use function trigger_deprecation;
use function ucfirst;
use function urldecode;
use function vsprintf;

/** @mixin TestCase */
trait HttpClientMockTrait
Expand Down Expand Up @@ -476,7 +477,7 @@ protected static function mockRequestMessage(
string $messageTemplate,
mixed ...$values,
): string {
$message = sprintf($messageTemplate, ...$values);
$message = vsprintf($messageTemplate, $values);

return $userMessage !== ''
? ucfirst($userMessage) . '. ' . $message
Expand Down
3 changes: 2 additions & 1 deletion src/HttpClientMock/Matcher/QueryParamMatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Brainbits\FunctionalTestHelpers\HttpClientMock\RealRequest;

use function sprintf;
use function vsprintf;

final readonly class QueryParamMatcher implements Matcher
{
Expand All @@ -15,7 +16,7 @@
/** @param array<string> $placeholders */
public function __construct(private string $key, string $value, array $placeholders)
{
$this->value = sprintf($value, ...$placeholders);
$this->value = vsprintf($value, $placeholders);
}

public function __invoke(RealRequest $realRequest): Hit|Mismatch|Missing
Expand Down
48 changes: 24 additions & 24 deletions src/ZipContents/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@

final class FileInfo
{
private const COMPRESSION_STORED = 0;
private const COMPRESSION_SHRUNK = 1;
private const COMPRESSION_REDUCED_FACTOR_1 = 2;
private const COMPRESSION_REDUCED_FACTOR_2 = 3;
private const COMPRESSION_REDUCED_FACTOR_3 = 4;
private const COMPRESSION_REDUCED_FACTOR_4 = 5;
private const COMPRESSION_IMPLODED = 6;
private const COMPRESSION_DEFLATED = 8;
private const COMPRESSION_DEFLATE64 = 9;
private const COMPRESSION_PKZIP = 10;
private const COMPRESSION_BZIP2 = 12;
private const COMPRESSION_LZMA = 14;
private const COMPRESSION_CMPSC = 16;
private const COMPRESSION_TERSE = 18;
private const COMPRESSION_LZ77 = 19;
private const COMPRESSION_ZSTD = 93;
private const COMPRESSION_MP3 = 94;
private const COMPRESSION_XZ = 95;
private const COMPRESSION_JPEG = 96;
private const COMPRESSION_WAVPACK = 97;
private const COMPRESSION_PPMD = 98;
private const COMPRESSION_AEX = 99;

private const COMPRESSION_MAP = [
private const int COMPRESSION_STORED = 0;
private const int COMPRESSION_SHRUNK = 1;
private const int COMPRESSION_REDUCED_FACTOR_1 = 2;
private const int COMPRESSION_REDUCED_FACTOR_2 = 3;
private const int COMPRESSION_REDUCED_FACTOR_3 = 4;
private const int COMPRESSION_REDUCED_FACTOR_4 = 5;
private const int COMPRESSION_IMPLODED = 6;
private const int COMPRESSION_DEFLATED = 8;
private const int COMPRESSION_DEFLATE64 = 9;
private const int COMPRESSION_PKZIP = 10;
private const int COMPRESSION_BZIP2 = 12;
private const int COMPRESSION_LZMA = 14;
private const int COMPRESSION_CMPSC = 16;
private const int COMPRESSION_TERSE = 18;
private const int COMPRESSION_LZ77 = 19;
private const int COMPRESSION_ZSTD = 93;
private const int COMPRESSION_MP3 = 94;
private const int COMPRESSION_XZ = 95;
private const int COMPRESSION_JPEG = 96;
private const int COMPRESSION_WAVPACK = 97;
private const int COMPRESSION_PPMD = 98;
private const int COMPRESSION_AEX = 99;

private const array COMPRESSION_MAP = [
self::COMPRESSION_STORED => 'stored (no compression)',
self::COMPRESSION_SHRUNK => 'Shrunk',
self::COMPRESSION_REDUCED_FACTOR_1 => 'Reduced with compression factor 1',
Expand Down
2 changes: 1 addition & 1 deletion tests/HttpClientMock/MockRequestBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public function testEmptyResponsesThrowsException(): void
$this->expectException(NoResponseMock::class);
$this->expectExceptionMessage('No response configured for:');

$mockRequestBuilder = (new MockRequestBuilder());
$mockRequestBuilder = new MockRequestBuilder();

$mockRequestBuilder->nextResponse();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/SevenZipContents/SevenZipContentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#[CoversClass(SevenZipContents::class)]
final class SevenZipContentsTest extends TestCase
{
private const FILE_7Z = __DIR__ . '/../files/test.7z';
private const string FILE_7Z = __DIR__ . '/../files/test.7z';

protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/SevenZipContents/SevenZipContentsTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ final class SevenZipContentsTraitTest extends TestCase
{
use SevenZipContentsTrait;

private const FILE = __DIR__ . '/../files/test.7z';
private const string FILE = __DIR__ . '/../files/test.7z';

protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ZipContents/ZipContentsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#[CoversClass(ZipContents::class)]
final class ZipContentsTest extends TestCase
{
private const FILE = __DIR__ . '/../files/test.zip';
private const string FILE = __DIR__ . '/../files/test.zip';

public function testItNeedsFile(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ZipContents/ZipContentsTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class ZipContentsTraitTest extends TestCase
{
use ZipContentsTrait;

private const FILE = __DIR__ . '/../files/test.zip';
private const string FILE = __DIR__ . '/../files/test.zip';

public function testAssertZipHasSizeForZipFileFails(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ZipContents/ZipInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#[CoversClass(ZipInfo::class)]
final class ZipInfoTest extends TestCase
{
private const FILE = __DIR__ . '/../files/test.zip';
private const string FILE = __DIR__ . '/../files/test.zip';

public function testZipFile(): void
{
Expand Down
Loading