[wp-trac] [WordPress Trac] #51423: Fix function argument type issues reported by PHPStan
WordPress Trac
noreply at wordpress.org
Mon Apr 19 15:52:42 UTC 2021
#51423: Fix function argument type issues reported by PHPStan
-------------------------------------------------+-------------------------
Reporter: SergeyBiryukov | Owner:
| hellofromTonya
Type: task (blessed) | Status: assigned
Priority: normal | Milestone: 5.8
Component: General | Version:
Severity: normal | Resolution:
Keywords: php8 has-patch has-unit-tests | Focuses: coding-
commit | standards
-------------------------------------------------+-------------------------
Comment (by hellofromTonya):
@SergeyBiryukov What do I think?
Type casting code: it's more concise with less lines of code, but IMO less
understandable for what happens and why with different values or lack of
value.
Why? When I read it, my first thought is: why is it type casting and doing
the processing when there are no emails to be processed.
I'd vote for the empty/is_array version for quick understanding and
eliminating unnecessary processing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/51423#comment:96>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list