[6.x] Image transforms#18480
Open
riasvdv wants to merge 12 commits intofeature/port-assets-servicefrom
Open
Conversation
8d9f2df to
eaff55f
Compare
There was a problem hiding this comment.
Pull request overview
This PR ports the image transforms functionality from the legacy Craft CMS architecture to the new Laravel-based architecture in version 6.x. It's a backwards-compatible implementation that maintains existing functionality while modernizing the codebase structure.
Changes:
- Introduces new ImageTransforms service, ImageTransformer, and ImageTransformHelper classes in the modern architecture
- Creates Data classes (ImageTransform, ImageTransformIndex) with proper validation
- Implements event system migration from Yii2 events to Laravel events with backwards-compatible bridges
- Adds comprehensive test coverage with unit and feature tests
- Updates legacy adapter code to delegate to new implementations via class aliases and facades
Reviewed changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Image/ImageTransforms.php | New singleton service managing image transforms with ProjectConfig integration |
| src/Image/ImageTransformer.php | Core transformer implementation handling transform generation and eager-loading |
| src/Image/ImageTransformHelper.php | Static helper methods for transform string parsing and manipulation |
| src/Image/Data/ImageTransform.php | Data class representing a transform with validation rules |
| src/Image/Data/ImageTransformIndex.php | Data class representing a transform index entry |
| src/Http/Controllers/Settings/ImageTransformsController.php | New controller for image transform CRUD operations |
| yii2-adapter/legacy/services/ImageTransforms.php | Legacy service wrapper delegating to new implementation |
| yii2-adapter/legacy/models/ImageTransform.php | Class alias to new Data class |
| tests/Unit/Image/* | Comprehensive unit tests for helper and data classes |
| tests/Feature/Image/* | Feature tests for service and transformer |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
This is a straight backwards compatible port of the current functionality. Any improvements we want to do to the image transforms can follow in subsequent PRs