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

Closes #734: Deprecated notice Imagify_Files_Iterator::accept() #748

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Sep 27, 2023

Description

Please include a summary of the change and which issue is fixed/closed. Please also include relevant motivation and context. List any dependencies that are required for this change.

With PHP 8.0+ a notice was appearing while using custom folders.

PHP Deprecated:  Return type of Imagify_Files_Iterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /shared/httpd/wprocketest/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-iterator.php on line 65

&

PHP Deprecated:  Return type of Imagify_Files_Recursive_Iterator::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/new.rocketlabsqa.ovh/htdocs/wp-content/plugins/imagify-plugin/inc/classes/class-imagify-files-recursive-iterator.php on line 55

This happened because FilterIterator::accept() is declared as it will returns a bool. However Imagify_Files_Recursive_Iterator::accept() wasn't explicitly saying that it will returns a bool.

Fixes #734

Type of change

  • Bug fix (non-breaking change which fixes an issue).

Is the solution different from the one proposed during the grooming?

There wasn't any solution provided, however, I've only added a return type to 2 functions.

Checklists

Generic development checklist

  • My code follows the style guidelines of this project, with adapted comments and without new warnings.
  • I have added unit and integration tests that prove my fix is effective or that my feature works.
  • The CI passes locally with my changes (including unit tests, integration tests, linter).
  • Any dependent changes have been merged and published in downstream modules.
  • If applicable, I have made corresponding changes to the documentation. Provide a link to the documentation.

Test summary

  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I validated all Acceptance Criteria of the related issues. (If applicable, provide proof).
  • I validated all test plan the QA Review asked me to.

@Miraeld Miraeld requested a review from a team September 27, 2023 05:41
@Miraeld Miraeld self-assigned this Sep 27, 2023
@vmanthos vmanthos self-requested a review September 29, 2023 12:41
Copy link
Contributor

@vmanthos vmanthos left a comment

Choose a reason for hiding this comment

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

There are no errors in the debug.log. 👍

@vmanthos vmanthos added this to the 2.1.3 milestone Sep 29, 2023
@vmanthos vmanthos added this pull request to the merge queue Sep 29, 2023
Merged via the queue into develop with commit cfe6f77 Sep 29, 2023
7 checks passed
@vmanthos vmanthos deleted the bug/734-deprecated_notice_imagify_files_iterator branch September 29, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP Deprecated notice for Imagify_Files_Iterator::accept()
3 participants