Add declare( strict_types = 1 ) to all PHP files#2424
Add declare( strict_types = 1 ) to all PHP files#2424meravi wants to merge 12 commits intoWordPress:trunkfrom
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
@westonruter would appreciate a quick look when you have a moment 🙏 |
performance.php
Outdated
| @@ -1,4 +1,5 @@ | |||
| <?php | |||
| declare( strict_types = 1 ); | |||
There was a problem hiding this comment.
Should be after the plugin info.
There was a problem hiding this comment.
Good catch, thanks! Moved it after the plugin header.
performance.php
Outdated
| * @package performance | ||
| */ | ||
|
|
||
| declare( strict_types = 1 ); |
There was a problem hiding this comment.
| declare( strict_types = 1 ); | |
| declare( strict_types = 1 ); |
westonruter
left a comment
There was a problem hiding this comment.
Thanks for the PR.
In addition to the trivial PHPCS issue which I left a suggestion for, there are unit test failures related to the new strict types. This will need to be fixed.
|
@meravi why remove the strict types? The underlying type problem should be fixed so the strict types can exist in all the files. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2424 +/- ##
=======================================
Coverage 69.33% 69.33%
=======================================
Files 90 90
Lines 7749 7749
=======================================
Hits 5373 5373
Misses 2376 2376
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I reverted it temporarily for testing, but it’s added back now. |
|
@meravi ok, you can see that the unit tests are still failing. Once they are passing this will be ready for review. |
I’ve fixed the issues, and the unit tests are now passing 🟢 |
plugins/performance-lab/includes/site-health/audit-autoloaded-options/helper.php
Outdated
Show resolved
Hide resolved
plugins/performance-lab/includes/site-health/audit-autoloaded-options/helper.php
Outdated
Show resolved
Hide resolved
plugins/performance-lab/includes/site-health/audit-autoloaded-options/helper.php
Outdated
Show resolved
Hide resolved
…options/helper.php Co-authored-by: Weston Ruter <westonruter@gmail.com>
…options/helper.php Co-authored-by: Weston Ruter <westonruter@gmail.com>
…options/helper.php Co-authored-by: Weston Ruter <westonruter@gmail.com>
Adds
declare( strict_types = 1 );to all PHP source files across the monorepo.Fixes #2348