Skip to content

fix: deprecated warnings and support PHP 8.2, 8.3, 8.4#43

Merged
Baspa merged 3 commits into
mainfrom
fix/deprecated-php-warnings
Aug 8, 2025
Merged

fix: deprecated warnings and support PHP 8.2, 8.3, 8.4#43
Baspa merged 3 commits into
mainfrom
fix/deprecated-php-warnings

Conversation

@Baspa
Copy link
Copy Markdown
Contributor

@Baspa Baspa commented Aug 6, 2025

No description provided.

@Baspa Baspa self-assigned this Aug 6, 2025
@Baspa
Copy link
Copy Markdown
Contributor Author

Baspa commented Aug 8, 2025

@cursor any suggestions for more fixes

@cursor
Copy link
Copy Markdown

cursor Bot commented Aug 8, 2025

Please finish setting up background agents. Go to Cursor

@Baspa
Copy link
Copy Markdown
Contributor Author

Baspa commented Aug 8, 2025

@cursor can you fix any deprecation warnings that may remain. If no warnings are left, please update the package to be compatible with PHP 8.3 as well, including updating tests.

@cursor
Copy link
Copy Markdown

cursor Bot commented Aug 8, 2025

I updated the project's dependencies, including PHP version compatibility and development tools, to their latest stable versions. Additionally, I refactored the transformation logic to enhance type safety and input validation, ensuring more robust handling of transformation parameters across various methods.

  • I updated the composer.json to broaden the php requirement to ^8.1|^8.2|^8.3 and upgraded various development dependencies, including pestphp/pest to ^2.0, phpstan/phpstan to ^1.12, and rector/rector to ^1.0.
  • I modernized phpunit.xml.dist to align with the PHPUnit 10 schema, updating the xsi:noNamespaceSchemaLocation and replacing the coverage/include tag with the new source tag.
  • I enhanced type safety in several transformation classes (e.g., BasicColorAdjustments, ConvertToSRGB, Filter, Format, Quality, SmartCrop) by adding explicit is_string or is_int checks and casting to (string) before passing values to tryFrom methods.
  • I refined parameter validation in Crop, CropByObjects, CropByRatio, Overlay, and Resize by adding explicit type checks before validating values with Offset::tryFrom or preg_match, preventing issues with unexpected input types.
  • I modified src/Transformations/TransformationsFinder.php and src/UploadcareTransformation.php to call static transformation methods using get_class($transformation['class'])::generateUrl, ensuring the method is invoked on the actual class name.

5 tasks completed

  • Explore the codebase structure and identify PHP files
  • Check for any remaining deprecation warnings in the code
  • Update package to be compatible with PHP 8.3
  • Update tests for PHP 8.3 compatibility
  • Verify all changes work correctly
Open in Cursor Open in Web

Learn more about Cursor Agents

cursoragent and others added 2 commits August 8, 2025 13:34
@Baspa Baspa changed the title fix: deprecated warnings in Transformations.php fix: deprecated warnings and support PHP 8.2, 8.3, 8.4 Aug 8, 2025
@Baspa Baspa merged commit de2211b into main Aug 8, 2025
28 checks passed
@Baspa Baspa deleted the fix/deprecated-php-warnings branch August 8, 2025 14:13
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.

2 participants