[wp-trac] [WordPress Trac] #35069: Allow short-circuiting wp_mail
WordPress Trac
noreply at wordpress.org
Thu Mar 1 17:54:56 UTC 2018
#35069: Allow short-circuiting wp_mail
-------------------------------------------------+-------------------------
Reporter: DvanKooten | Owner:
Type: enhancement | Status: assigned
Priority: low | Milestone: Future
Component: Mail | Release
Severity: normal | Version:
Keywords: has-patch has-unit-tests needs- | Resolution:
refresh | Focuses:
-------------------------------------------------+-------------------------
Comment (by birgire):
@Mte90 your {{{null}}} suggestion sounds ideal, to have the ability to
return both {{{false}}} or {{{true}}}.
A minor refresh to keep the ticket going forward.
In [attachment:35069.5.diff] there are some minor docblock changes, like:
- Changed {{{@args}}} to {{{$atts}}}.
- Changed {{{@param bool $return}}} to {{{@param null|bool $return}}}.
- Changed {{{Passing a truthy value}}} to {{{Passing a non-null value}}}.
Also it removes white spaces according to the Coding Standard.
It uses a {{{null !== }}} check instead of {{{! is_null()}}} as it seems
to be more often used in the core for short-circuits. I guess the former
is more readable?
Adjusts the test method:
- Avoided the cleanup after the assertion.
- Added a test method description, according to the Coding Standard.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35069#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list