Skip to content

Conversation

@josbeir
Copy link
Owner

@josbeir josbeir commented Dec 25, 2025

No description provided.

Copilot AI review requested due to automatic review settings December 25, 2025 11:58
@josbeir josbeir added the enhancement New feature or request label Dec 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.27%. Comparing base (9b8859a) to head (a009c2b).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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.
📢 Have feedback on the report? Share it here.

Copy link

Copilot AI left a 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 HashUtility class with hash() and hashFile() static methods for consistent hashing
  • Refactored all direct hash('xxh3', ...) and hash_file('xxh3', ...) calls to use the new utility
  • Renamed REGISTRY_CACHE_KEY_ALL constant to CACHE_KEY in 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.

@josbeir josbeir merged commit 7e00139 into main Dec 25, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants