Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Varien_Directory_Collection::getLastDir(): "$this" can no longer be used in a plain function or method, since PHP 7.1 #3823

Merged
merged 3 commits into from
Mar 2, 2024

Conversation

fballiano
Copy link
Contributor

PHPCS is generating this error:

FILE: /Users/fab/Projects/openmage/lib/Varien/Directory/Collection.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 149 | ERROR | "$this" can no longer be used in a plain function or method
     |       | since PHP 7.1.
     |       | (PHPCompatibility.Variables.ForbiddenThisUseContexts.OutsideObjectContext)
--------------------------------------------------------------------------------

This method is static but has a $this in it we shouldn't be there.

Checking the way that method is used in the core:
Screenshot 2024-02-09 alle 09 33 13

I think we can safely remove that part of the method.

…sed in a plain function or method, since PHP 7.1
@github-actions github-actions bot added Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/* labels Feb 9, 2024
Copy link
Contributor

@kiatng kiatng left a comment

Choose a reason for hiding this comment

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

LGTM

@Flyingmana
Copy link
Contributor

hmm, will check later, because I have a feeling this static method might have been used in a non-static way

@fballiano
Copy link
Contributor Author

Please everybody note that the EGC workflow fails on every PR with many errors:
https://github.com/OpenMage/magento-lts/actions/runs/7986772621/job/21807865811?pr=3823
and we never noticed

This PR is the start of the fix for all of those.

@fballiano fballiano merged commit 4caaafe into OpenMage:main Mar 2, 2024
17 checks passed
@fballiano fballiano deleted the this_getpath branch March 2, 2024 23:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants