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

check included files for defined classes before include #3369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ktomk
Copy link
Contributor

@ktomk ktomk commented Jun 2, 2021

including a file that re-redefines leads to a fatal error, making phpcs
fail hard.

including files from a rule-set while these files may have already been
included (likely by auto-loading and could then be seen as a race-
condition) now checks if it has been already included and if so, searches
all loaded classes for the class-name and if found, verifies the class
is from that file.

this effectively prevents the fatal error and works for classes / files
with a PSR-4 naming scheme.

including a file that re-redefines leads to a fatal error, making phpcs
fail hard.

including files from a rule-set while these files may have already been
included (likely by auto-loading and could then be seen as a race-
condition) now checks if it has been already included and if so, searches
all loaded classes for the class-name and if found, verifies the class
is from that file.

this effectively prevents the fatal error and works for classes / files
with a PSR-4 naming scheme.
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.

1 participant