-
Notifications
You must be signed in to change notification settings - Fork 25
refactor: use xxh hash #85
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
refactor: use xxh hash #85
Conversation
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 replaces direct usage of PHP's native hash functions (md5(), hash(), hash_file()) with Shopware's Hasher utility class across the codebase. This change aligns with Shopware's coding standards and centralizes hash generation through a framework-provided utility.
- Replaces
\md5()and\hash('md5', ...)calls withHasher::hash() - Updates phpstan configuration to remove exceptions for hash function usage
- Standardizes hash generation across converters, resolvers, and services
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Profile/Shopware/Media/Strategy/Md5StrategyResolver.php | Replaces \md5() with Hasher::hash() for path hashing |
| src/Profile/Shopware/Converter/ShippingMethodConverter.php | Updates hash generation for availability rule data |
| src/Profile/Shopware/Converter/PropertyGroupOptionConverter.php | Replaces multiple \hash('md5', ...) calls with Hasher::hash() for property group identifiers |
| src/Profile/Shopware/Converter/ProductPropertyRelationConverter.php | Updates property group option mapping hash generation |
| src/Profile/Shopware/Converter/ProductOptionRelationConverter.php | Updates product option mapping hash generation |
| src/Profile/Shopware/Converter/ProductConverter.php | Replaces hash calls in option and translation mapping methods |
| src/Profile/Shopware/Converter/OrderConverter.php | Updates deep link code generation with Hasher::hash() |
| src/Migration/Service/MigrationDataConverter.php | Updates checksum generation for migration data |
| src/Migration/Media/Processor/HttpDownloadServiceBase.php | Replaces hash_file() with Hasher::hash() for file hash generation |
| src/Migration/Converter/Converter.php | Updates checksum generation in base converter class |
| phpstan.neon.dist | Removes ignore rules for hash function usage that are no longer needed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1a45ba1 to
ed75250
Compare
src/Profile/Shopware/Converter/PropertyGroupOptionConverter.php
Outdated
Show resolved
Hide resolved
…or' into refactor/use-xxh-hash-algo-for-migration-checksums
4409572
into
feature/migration-logging-refactor
resolves #13391
use
xxh128where possible for better performance & useHasherutil for all hashing uses.