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 a PHP fatal error with the log_sync function #742

Merged
merged 2 commits into from
Mar 23, 2021
Merged

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Mar 19, 2021

Description of the Change

In the latest Distributor release, we added an optional parameter to the log_sync method that is used to overwrite the log. The base method we extended had a type declaration on that optional value to bool but the two places we extended this method didn't have that same type declaration. In PHP versions 7.0 and 7.1, this will cause a fatal error to be thrown because those function signatures don't match.

In addition, PHP 5.6 does not support scalar type declarations, which bool is considered a scalar type. Because we still support PHP 5.6, this PR removes the bool type declaration so no errors will happen in 5.6, 7.0 or 7.1.

Alternate Designs

None

Benefits

No PHP fatals on PHP version <7.2

Possible Drawbacks

None

Verification Process

  • Install the latest version of Distributor on a site running PHP <7.2
  • Should get a fatal error
  • Checkout this PR in same environment
  • Everything should work now

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

Fixes #734. Related #735

…the abstract function, otherwise older versions of PHP will throw errors
@dkotter dkotter self-assigned this Mar 19, 2021
@jeffpaul jeffpaul added this to the 1.6.4 milestone Mar 22, 2021
@jeffpaul jeffpaul added the type:bug Something isn't working. label Mar 22, 2021
Copy link
Contributor

@helen helen left a comment

Choose a reason for hiding this comment

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

LGTM

@jeffpaul jeffpaul merged commit 961d054 into develop Mar 23, 2021
@jeffpaul jeffpaul deleted the fix/php-fatal branch March 23, 2021 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Site crashed on the 1.6.3 version
3 participants