Repository navigation
chore(deps): upgrade to PHPStan 2 and fix the Redis cache - #79
Merged
Merged
Conversation
RedisCache::set() passed its default expiration of 0 to phpredis, which rejects it and stores nothing: the Redis cache never kept a value set without expiration. The expiration is now passed as an EX option. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop checks the types already guarantee, tighten return and property types, and keep the user-facing traits out of the unused-trait rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The first declared Composer ClassLoader wins, and it may come from a WP-CLI phar or a plugin vendor built with an older Composer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Contexte
Étape 6d : passage à PHPStan 2. Sa montée de version a révélé un vrai bug.
Changements
RedisCache::set()ne stockait rien sans expiration. Son expiration par défaut (0) était passée à phpredis, qui la refuse : la fonction renvoiefalseavec le warning int passed as EXPIRY is invalid, et n'enregistre rien. Vérifié sur un vrai Redis 7 avec phpredis. L'expiration est maintenant passée sous la forme['EX' => $expire], et l'absence d'expiration n'envoie aucune option. Le constructeur accepte un client injecté, ce qui sert aux tests et reste compatible.szepeviktor/phpstan-wordpress2.0 : les 12 erreurs sont corrigées.catchdeFilesystemIterator, qui peut lever une exception à l'exécution, et le contrôle de type des services de shortcode, que le conteneur ne vérifie pas.ServiceCacheTraitetHasCachedPropertiessont proposés aux utilisateurs : ils sont conservés, avec une exclusion ciblée.CacheFingerprintest supprimé.Vérification
RedisCacheTestéchouait avant la correction. Tests unitaires : 107 sur 8.2 et 8.4. Intégration : 4/4. PHPStan : aucune erreur.🤖 Generated with Claude Code