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

Force $(days|months|years)_being_processed to an array. #134

Merged
merged 2 commits into from May 1, 2018

Conversation

kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Apr 22, 2018

Previously, if these options were not set (e.g. when generating a single day's sitemap), it would return the bool false, which is not countable.
In PHP versions 7.1-, PHP would proceed with count by returning 1. This would result in the logic checks to true unexpectedly, leading in the entire sitemap being rebuilt for every modified post.

In PHP version 7.2, this throws a warning for usage of count on a non-countable, so this change also improves 7.2 compatibility.

Previously, if these options were not set (e.g. when generating a single day's sitemap), it would return the bool `false`, which is not countable.
In PHP versions 7.1-, PHP would proceed with `count` by returning 1. This would result in the logic checks to true unexpectedly, leading in the entire sitemap being rebuilt for every modified post.

In PHP version 7.2, this throws a warning for usage of `count` on a non-countable, so this change also improves 7.2 compatability.
@sboisvert
Copy link

LGTM, I like that you split up the whitespace changes into a separate commit.

@kraftbj kraftbj merged commit 4b4935c into master May 1, 2018
@kraftbj kraftbj deleted the fix/mass-generation branch May 1, 2018 14:58
@mattoperry
Copy link

Nice job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants