Update docs: fix README usage examples, add CI badges, document README-sync convention - #7
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
README.md
CI status badges added under the title (Tests, PHPStan, Code style), pointing at the
trm42/CacheDecoratorworkflow files imported in PR Import CI workflows from spatie/package-skeleton-laravel #6.Usage examples fixed to compile and run against the current code. Recent commits (US-007) made the configurable properties on
CacheDecoratorstrictly typed, so the old untyped redeclarations (protected $ttl = 300;,protected $prefix_key = 'reports';, etc.) would now be a fatal error. Each example now:protected ?string $prefix_key,protected array $excludes, etc.);protected $ttl = 300;line —getConfig()runs in the constructor and overwrites$ttlfrom config, so it never took effect; replaced with a note that TTL comes from config orsetTtl();#[\Override]ondecoratedClass()overrides (US-006);@extends CacheDecorator<...>/@extends RepositoryCacheDecorator<...>PHPDoc for IDE/PHPStan type inference (US-005 generics).These now follow the same conventions as the test stubs under
src/tests/Stubs/.CLAUDE.md
src/change affecting the main classes' public-facing surface must be documented inREADME.mdas part of the same change, since the usage examples are a core part of the package DX.Also included (from prior work on this branch, not yet in master)
run-tests,phpstan,fix-php-code-style-issues,dependabot-auto-merge).stubs→Stubsto match the PSR-4 namespace.Why
The documented examples no longer matched the code and would fatal-error on copy-paste; the badges surface CI status; the CLAUDE.md convention prevents the docs from drifting again.
Verification
composer checkgreen: 28 tests pass, PHPStan reports no errors, Pint passes.