-
Notifications
You must be signed in to change notification settings - Fork 1
Add hashing utility and refactor all entries #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6 +/- ##
============================================
+ Coverage 95.25% 95.27% +0.01%
- Complexity 317 319 +2
============================================
Files 20 21 +1
Lines 1011 1015 +4
============================================
+ Hits 963 967 +4
Misses 48 48 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a centralized HashUtility class to standardize hashing operations across the codebase and performs related refactoring. The utility encapsulates the xxh3 hashing algorithm used for cache key generation and file integrity validation, replacing direct calls to PHP's hash() and hash_file() functions throughout the codebase.
Key changes:
- Added
HashUtilityclass withhash()andhashFile()static methods for consistent hashing - Refactored all direct
hash('xxh3', ...)andhash_file('xxh3', ...)calls to use the new utility - Renamed
REGISTRY_CACHE_KEY_ALLconstant toCACHE_KEYin AttributeRegistry - Updated test method names in PathResolverTest to be more concise and clear
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Utility/HashUtility.php | New utility class providing centralized xxh3 hashing with comprehensive documentation |
| tests/TestCase/Utility/HashUtilityTest.php | Comprehensive test suite for the new HashUtility class |
| src/Service/CompiledCache.php | Replaced direct hash() and hash_file() calls with HashUtility methods |
| src/Service/AttributeParser.php | Replaced hash_file() call with HashUtility::hashFile() |
| src/Service/AttributeCacheValidator.php | Replaced hash_file() call with HashUtility::hashFile() |
| src/AttributeRegistry.php | Renamed cache key constant and updated all references to use HashUtility |
| tests/TestCase/Service/CompiledCacheTest.php | Updated test assertions to use HashUtility for consistency |
| tests/TestCase/Service/AttributeCacheValidatorTest.php | Updated test setup to use HashUtility::hashFile() |
| tests/TestCase/AttributeRegistryTest.php | Updated cache filename expectations to match new constant name and hash |
| tests/TestCase/Service/PathResolverTest.php | Simplified test method names for better readability |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.