Skip to content
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

Add Image validation rule #670

Merged
merged 24 commits into from Mar 28, 2024
Merged

Add Image validation rule #670

merged 24 commits into from Mar 28, 2024

Conversation

vjik
Copy link
Member

@vjik vjik commented Mar 23, 2024

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Fixed issues

Copy link

what-the-diff bot commented Mar 23, 2024

PR Summary

  • Changelog Documentation Update
    An entry has been made to the CHANGELOG.md file. This acts as the recording log of changes made.
  • File Information in Composer Checker
    The composer-require-checker.json file has been updated to include "fileinfo".
  • PSR HTTP Message Dependency in Composer
    The composer.json file has received an update to include the "psr/http-message", a fundamental component for handling HTTP messages.
  • New Image Rule File
    A new Image rule file has been introduced. This is a central rule set related to image handling.
  • New ImageHandler File
    A new ImageHandler file has been introduced. It will provide a programmatic interface to manipulate or otherwise interact with images.
  • RuleTestCase Update
    Updates have been made to the RuleTestCase file, presumably improving or amplifying test coverage.
  • CompareTest Update
    The CompareTest file has been updated, which likely means refinement in testing procedures for comparison-related functionalities.
  • New Images Addition
    New 16x18.jpg and 16x18.png images have been introduced.
  • New ImageTest File
    A new ImageTest file has been created. This suggests that an enhanced testing process is set up for image-related operations/features.

Copy link

codecov bot commented Mar 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (1.x@d9a7bf7). Click here to learn what that means.

Additional details and impacted files
@@          Coverage Diff           @@
##             1.x     #670   +/-   ##
======================================
  Coverage       ?   94.94%           
  Complexity     ?      835           
======================================
  Files          ?       96           
  Lines          ?     2553           
  Branches       ?        0           
======================================
  Hits           ?     2424           
  Misses         ?      129           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/Rule/ImageHandler.php Outdated Show resolved Hide resolved
src/Rule/Image.php Outdated Show resolved Hide resolved
src/Rule/Image.php Outdated Show resolved Hide resolved
src/Rule/ImageHandler.php Outdated Show resolved Hide resolved
@arogachev arogachev self-requested a review March 26, 2024 07:38
@arogachev arogachev added the type:feature New feature label Mar 26, 2024
@arogachev arogachev added this to the 1.3 milestone Mar 26, 2024
private ?int $maxWidth = null,
private ?int $maxHeight = null,
private string $notImageMessage = 'The value must be an image.',
private string $notExactlyWidthMessage = 'The width of image "{attribute}" must be exactly {exactly, number} {exactly, plural, one{pixel} other{pixels}}.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Validating aspect ratio is quite a popular case too. Can be added iteratively in a separate PR.

src/Rule/Image.php Outdated Show resolved Hide resolved
@arogachev
Copy link
Contributor

Docs related additions - #671.

CHANGELOG.md Outdated Show resolved Hide resolved
@vjik vjik added the status:under development Someone is working on a pull request. label Mar 26, 2024
@vjik vjik added status:code review The pull request needs review. and removed status:under development Someone is working on a pull request. labels Mar 26, 2024
@vjik vjik requested a review from a team March 26, 2024 13:16
src/Rule/Image/Image.php Outdated Show resolved Hide resolved
src/Rule/Image/ImageHandler.php Outdated Show resolved Hide resolved
src/Rule/Image/ImageHandler.php Outdated Show resolved Hide resolved
vjik and others added 3 commits March 28, 2024 14:42
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
Co-authored-by: Alexander Makarov <sam@rmcreative.ru>
@vjik vjik merged commit 66cfeae into 1.x Mar 28, 2024
34 of 35 checks passed
@vjik vjik deleted the image-validator branch March 28, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:code review The pull request needs review. type:feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants