Skip to content

Conversation

@larskemper
Copy link
Member

@larskemper larskemper commented Nov 10, 2025

resolves #13391

use xxh128 where possible for better performance & use Hasher util for all hashing uses.

@larskemper larskemper requested a review from Copilot November 10, 2025 07:23
@larskemper larskemper self-assigned this Nov 10, 2025
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 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 with Hasher::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.

@larskemper larskemper force-pushed the refactor/use-xxh-hash-algo-for-migration-checksums branch from 1a45ba1 to ed75250 Compare November 10, 2025 07:46
@larskemper larskemper marked this pull request as ready for review November 10, 2025 07:46
@larskemper larskemper merged commit 4409572 into feature/migration-logging-refactor Nov 18, 2025
8 checks passed
@larskemper larskemper deleted the refactor/use-xxh-hash-algo-for-migration-checksums branch November 18, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants