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

Only define global functions qp(), htmlqp(), and html5qp() if they haven't already been defined #53

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

jakejackson1
Copy link
Member

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

If another package has already defined the global functions qp(), htmlqp(), and html5qp() a fatal PHP error will be produced.

Issue Number: #52

What is the new behavior?

The fatal error will not be produced. However, this is only a stop-gap solution for this specific circumstance, as the library isn't likely to work as expected when these global functions are called.

Long term, these functions should be deprecated and all examples updated to use the namespaced classes directly (or a new interface).

Does this introduce a breaking change?

  • Yes
  • No

@jakejackson1 jakejackson1 added the bug Something isn't working label Oct 31, 2024
Copy link

codecov bot commented Oct 31, 2024

Codecov Report

Attention: Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 89.28%. Comparing base (a7bebcb) to head (6f8813c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/qp_functions.php 33.33% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main      #53      +/-   ##
============================================
- Coverage     89.45%   89.28%   -0.18%     
  Complexity     1349     1349              
============================================
  Files            26       26              
  Lines          3036     3127      +91     
============================================
+ Hits           2716     2792      +76     
- Misses          320      335      +15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jakejackson1 jakejackson1 merged commit 020143c into main Oct 31, 2024
10 of 12 checks passed
@jakejackson1 jakejackson1 deleted the global-functions branch October 31, 2024 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant