Skip to content

Fix caching issues#19

Draft
uuf6429 wants to merge 6 commits into
mainfrom
fix-caching
Draft

Fix caching issues#19
uuf6429 wants to merge 6 commits into
mainfrom
fix-caching

Conversation

@uuf6429
Copy link
Copy Markdown
Owner

@uuf6429 uuf6429 commented May 20, 2026

Fixes #18.

  • Add cache integration test
  • Ensure test fails in older situation and passes with the fix
  • Fix AbstractFormatter:
    abstract class AbstractFormatter implements JsonSerializable
    ...
    /**
     * @return array<string, mixed>
     */
    public function jsonSerialize(): array
    {
        return ['class' => static::class, 'version' => $this->version];
    }
  • Override jsonSerialize() in child formatters to provide details about the formatter (e.g. to distinguish between cli formatters with same class, different command)
  • Prepare for major version release, since changes are not backward compatible.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
54 1 53 1
View the top 1 failed test(s) by shortest run time
uuf6429.PhpCsFixerBlockstringTests.Integration.CacheTest::testCacheReuse with data set #2
Stack Traces | 0.582s run time
uuf6429\PhpCsFixerBlockstringTests\Integration\CacheTest::testCacheReuse with data set #2 ('Test v2', 'Fixed 1 of 1 files', 'Cache file existed already')
Failed asserting that 'You are running PHP CS Fixer on PHP 8.4.21, but the minimum PHP version supported by your project in composer.json is PHP 7.4. Executing PHP CS Fixer on newer PHP versions may introduce syntax or features not yet available in PHP 7.4, which could cause issues under that version. It is recommended to run PHP CS Fixer on PHP 7.4, to fit your project specifics.\n
If you need help while solving warnings, ask at https://github..../PHP-CS-Fixer/PHP-CS-Fixer/discussions/, we will help you!\n
\n
PHP CS Fixer 3.95.2 Adalbertus by Fabien Potencier, Dariusz Ruminski and contributors.\n
PHP runtime: 8.4.21\n
Loaded config default from ".../tests/Integration/../fixtures/simple-config.php".\n
Running analysis on 1 core sequentially.\n
Using cache file ".../_nsk_h4s1kng41z5pgfbx7sh0000gn/T/pcf-cache-test-6a0f599ce63027.79160952/cache.json".\n
\n
Fixed 0 of 1 files in 0.005 seconds, 16.00 MB memory used\n
' contains "Fixed 1 of 1 files".

.../tests/Integration/CacheTest.php:79

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Comment thread tests/Integration/CacheTest.php Outdated
Comment thread phpunit.xml.dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uuf6429/block_string rule breaks php-cs-fixer cache (every run is a full re-run)

1 participant