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

fix: check if classes are already loaded before attempting to autoload them. #442

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

justlevine
Copy link
Member

What

This PR updates the Autoloader to check if our main GF class is already loaded, before attempting to load the autoloader

Why

If the entire package is loaded as a dependency, it's possible the autoloader will be generated higher up in the tree.

Fixes #439

How

Instead of coupling this to Composer, we use a class_exists() check.

Testing Instructions

Additional Info

Checklist:

  • This PR is tested to the best of my abilities.
  • This PR follows the WordPress Coding Standards.
  • This PR has proper inline documentation.
  • This PR has unit tests to verify the code works as intended.
  • The changes in this PR have been noted in CHANGELOG.md

@justlevine justlevine added the safe to test ✔ This PR can be run using repository secrets label Aug 2, 2024
@justlevine justlevine merged commit d190465 into develop Aug 2, 2024
17 of 20 checks passed
@justlevine justlevine deleted the fix/parent-autoloader branch August 2, 2024 22:29
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10222692586

Details

  • 0 of 2 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 84.035%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/Autoloader.php 0 2 0.0%
Totals Coverage Status
Change from base Build 9535520304: -0.02%
Covered Lines: 6390
Relevant Lines: 7604

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test ✔ This PR can be run using repository secrets
Projects
None yet
Development

Successfully merging this pull request may close these issues.

plugin doesnt use top level vendor folder
2 participants