Skip to content

[BUGFIX] Fix type errors in PHP strict mode #664

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

Merged
merged 2 commits into from
Aug 27, 2024
Merged

Conversation

oliverklee
Copy link
Collaborator

No description provided.

@oliverklee oliverklee added this to the 8.6.1 or 8.7.0 milestone Aug 24, 2024
@oliverklee oliverklee self-assigned this Aug 24, 2024
@oliverklee
Copy link
Collaborator Author

This fix fixes the type errors in strict mode as seen on this build: https://github.com/MyIntervals/PHP-CSS-Parser/actions/runs/10540068716/job/29204329414?pr=641

Copy link
Collaborator

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

This is more of a code cleanup than an actual bugfix, so I'm not sure the changelog entry is warranted. It's also ambiguous since the library itself (currently) has a 'strict mode' option for the CSS.

CHANGELOG.md Outdated
@@ -46,6 +46,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).

### Fixed

- Fix type errors in strict mode (#664)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it should be clarified that this refers to PHP's strict mode. The library itself also has a strict mode setting for the CSS (which we plan to remove).

Though I'm not sure this warrants a changelog entry at all. It's not fixing any actual bug; merely allowing for declare_strict to be introduced, with a couple of explicit casts to replace the implicit ones.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've clarified this accordingly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'd like to keep the changelog entry. This was actually something where the code was incorrect (passing a float or int where only a string was allowed) - only PHP's implicit type conversations had allowed us to get away with this so far. 😉

@oliverklee oliverklee changed the title [BUGFIX] Fix type errors in strict mode [BUGFIX] Fix type errors in PHP strict mode Aug 26, 2024
@oliverklee oliverklee requested a review from JakeQZ August 26, 2024 15:28
Copy link
Collaborator

@JakeQZ JakeQZ left a comment

Choose a reason for hiding this comment

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

👍

@JakeQZ JakeQZ merged commit 88ddf94 into main Aug 27, 2024
20 checks passed
@JakeQZ JakeQZ deleted the bugfix/type-errors branch August 27, 2024 00:00
oliverklee added a commit that referenced this pull request Aug 28, 2024
JakeQZ pushed a commit that referenced this pull request Aug 28, 2024
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.

2 participants