From 91f715ff60448e37e321537617571d7f09e5c437 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 10 Nov 2025 18:29:07 +0100 Subject: [PATCH 01/11] upgrading from phpstan 1x to 2x --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index a01c3d2..47cd9ab 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", - "phpstan/phpstan": "^1", + "phpstan/phpstan": "^2", "phpunit/phpunit": "^10", "squizlabs/php_codesniffer": "^3" }, From bf2d9f004a33c3b193cecb1718c345405a7a0464 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 10 Nov 2025 18:30:29 +0100 Subject: [PATCH 02/11] update license year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index bf7a9a3..bfcf021 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 odan +Copyright (c) 2025 odan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From bb9ce775b7131853c07c31396bbd3792fa9fa2a3 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 10 Nov 2025 18:36:25 +0100 Subject: [PATCH 03/11] Upgrade of squizlabs/php_codesniffer from ^3 to ^4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 47cd9ab..5b135fa 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "friendsofphp/php-cs-fixer": "^3", "phpstan/phpstan": "^2", "phpunit/phpunit": "^10", - "squizlabs/php_codesniffer": "^3" + "squizlabs/php_codesniffer": "^4" }, "autoload": { "psr-4": { From 79cdfb192fd0a82bb9db94505d44d3a68d7e6175 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Fri, 14 Nov 2025 13:22:45 +0100 Subject: [PATCH 04/11] update requirements --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index effe168..17aea74 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Audio format detection library for PHP. ## Requirements -* PHP 8.1+ +* PHP 8.1 - 8.5 ## Installation From c9a9a6e4391f45274707678db0da72646be84e71 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Fri, 14 Nov 2025 17:41:38 +0100 Subject: [PATCH 05/11] Upgrade of PHPUnit from ^10 to ^12 and update test --- composer.json | 9 ++++++--- phpunit.xml | 2 +- tests/AudioTypeDetectorTest.php | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index 5b135fa..ef4e4bc 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "require-dev": { "friendsofphp/php-cs-fixer": "^3", "phpstan/phpstan": "^2", - "phpunit/phpunit": "^10", + "phpunit/phpunit": "^12", "squizlabs/php_codesniffer": "^4" }, "autoload": { @@ -43,13 +43,16 @@ "sniffer:check": "phpcs --standard=phpcs.xml", "sniffer:fix": "phpcbf --standard=phpcs.xml", "stan": "phpstan analyse -c phpstan.neon --no-progress --ansi", - "test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always", + "test": "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --display-warnings --display-deprecations", "test:all": [ "@cs:check", "@sniffer:check", "@stan", "@test" ], - "test:coverage": "php -d xdebug.mode=coverage -r \"require 'vendor/bin/phpunit';\" -- --configuration phpunit.xml --do-not-cache-result --colors=always --coverage-clover build/logs/clover.xml --coverage-html build/coverage" + "test:coverage": [ + "@putenv XDEBUG_MODE=coverage", + "phpunit --configuration phpunit.xml --do-not-cache-result --colors=always --display-warnings --display-deprecations --coverage-clover build/coverage/clover.xml --coverage-html build/coverage --coverage-text" + ] } } diff --git a/phpunit.xml b/phpunit.xml index f97af40..9e3bbb2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,6 +1,6 @@ diff --git a/tests/AudioTypeDetectorTest.php b/tests/AudioTypeDetectorTest.php index 3d2ed83..43576f6 100644 --- a/tests/AudioTypeDetectorTest.php +++ b/tests/AudioTypeDetectorTest.php @@ -2,6 +2,7 @@ namespace Selective\AudioType\Test; +use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Selective\AudioType\AudioFormat; use Selective\AudioType\AudioMimeType; @@ -34,14 +35,13 @@ private function createDetector(): AudioTypeDetector /** * Test. * - * @dataProvider providerGetAudioTypeFromFile - * * @param string $file The file * @param string $format The expected format * @param string $mime The expected mime type * * @return void */ + #[DataProvider('providerGetAudioTypeFromFile')] public function testGetAudioTypeFromFile(string $file, string $format, string $mime): void { $this->assertFileExists($file); From 436ac379f6f3e29c06bc8bcb5f7272f5d4dd95ac Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Fri, 14 Nov 2025 18:29:03 +0100 Subject: [PATCH 06/11] cs-fix, yoda style --- src/Detector/FlacDetector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Detector/FlacDetector.php b/src/Detector/FlacDetector.php index b8553a0..edb24fd 100644 --- a/src/Detector/FlacDetector.php +++ b/src/Detector/FlacDetector.php @@ -24,7 +24,7 @@ public function detect(SplFileObject $file): ?AudioType // Signature bytes $signature = (string)$file->fread(4); - return 'fLaC' === $signature ? new AudioType( + return $signature === 'fLaC' ? new AudioType( AudioFormat::FLAC, AudioMimeType::AUDIO_FLAC ) : null; From 1dde689895e84599e6257d5a6ff957c92e1ef45e Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Fri, 14 Nov 2025 18:30:59 +0100 Subject: [PATCH 07/11] fixed PHP_CS_FIXER_IGNORE_ENV deprecation --- .cs.php | 8 ++++++-- composer.json | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.cs.php b/.cs.php index 2bba5e9..52c4c3e 100644 --- a/.cs.php +++ b/.cs.php @@ -19,7 +19,7 @@ 'array_syntax' => ['syntax' => 'short'], 'cast_spaces' => ['space' => 'none'], 'concat_space' => ['spacing' => 'one'], - 'compact_nullable_typehint' => true, + 'compact_nullable_type_declaration' => true, 'declare_equal_normalize' => ['space' => 'single'], 'general_phpdoc_annotation_remove' => [ 'annotations' => [ @@ -36,7 +36,11 @@ 'phpdoc_order' => true, // psr-5 'phpdoc_no_useless_inheritdoc' => false, 'protected_to_private' => false, - 'yoda_style' => false, + 'yoda_style' => [ + 'equal' => false, + 'identical' => false, + 'less_and_greater' => false + ], 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline'], 'ordered_imports' => [ 'sort_algorithm' => 'alpha', diff --git a/composer.json b/composer.json index ef4e4bc..2d38c4c 100644 --- a/composer.json +++ b/composer.json @@ -33,12 +33,10 @@ }, "scripts": { "cs:check": [ - "@putenv PHP_CS_FIXER_IGNORE_ENV=1", - "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi" + "php-cs-fixer fix --dry-run --format=txt --verbose --diff --config=.cs.php --ansi --allow-unsupported-php-version=yes" ], "cs:fix": [ - "@putenv PHP_CS_FIXER_IGNORE_ENV=1", - "php-cs-fixer fix --config=.cs.php --ansi --verbose" + "php-cs-fixer fix --config=.cs.php --ansi --verbose --allow-unsupported-php-version=yes" ], "sniffer:check": "phpcs --standard=phpcs.xml", "sniffer:fix": "phpcbf --standard=phpcs.xml", From d5c4ef2c2c22bcf2aceec2562313b23889a7c650 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Mon, 24 Nov 2025 16:01:20 +0100 Subject: [PATCH 08/11] Updating supported PHP versions --- .github/workflows/build.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a4bf3d5..4c3d3a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: operating-system: [ ubuntu-latest ] - php-versions: [ '8.1', '8.2' ] + php-versions: [ '8.2', '8.3', '8.4', '8.5' ] name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} steps: diff --git a/composer.json b/composer.json index 2d38c4c..5c8cc4f 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "homepage": "https://github.com/selective-php/audio-type", "require": { - "php": "^7.3 || ^8.0" + "php": "8.2.* || 8.3.* || 8.4.* || 8.5.*" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", From 7a250d2ab9645451c8d4d428e0cf3d80d22a73d5 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Wed, 18 Feb 2026 11:52:49 +0100 Subject: [PATCH 09/11] Revert "update license year" This reverts commit bf2d9f004a33c3b193cecb1718c345405a7a0464. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index bfcf021..bf7a9a3 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2025 odan +Copyright (c) 2023 odan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 332c917c2322c5954d3e84de1046ba54e1fa2889 Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Wed, 18 Feb 2026 11:54:25 +0100 Subject: [PATCH 10/11] update license year to 2026 --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index bf7a9a3..2013f40 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2023 odan +Copyright (c) 2026 odan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From ef16318601d0531e42ade450e617983acda39a7b Mon Sep 17 00:00:00 2001 From: heinrichschiller Date: Tue, 24 Feb 2026 12:49:37 +0100 Subject: [PATCH 11/11] downgrade phpunit from v12 to v11 for php 8.2 compatibility --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 5c8cc4f..fa9539e 100644 --- a/composer.json +++ b/composer.json @@ -10,12 +10,12 @@ ], "homepage": "https://github.com/selective-php/audio-type", "require": { - "php": "8.2.* || 8.3.* || 8.4.* || 8.5.*" + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", "phpstan/phpstan": "^2", - "phpunit/phpunit": "^12", + "phpunit/phpunit": "^11", "squizlabs/php_codesniffer": "^4" }, "autoload": {