[wp-trac] [WordPress Trac] #54323: Too few arguments for function (closure)
WordPress Trac
noreply at wordpress.org
Wed Oct 27 16:24:57 UTC 2021
#54323: Too few arguments for function (closure)
----------------------------------------+-------------------------------
Reporter: aristath | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.8.2
Component: Script Loader | Version:
Severity: major | Resolution:
Keywords: has-patch needs-unit-tests | Focuses: coding-standards
----------------------------------------+-------------------------------
Changes (by jrf):
* keywords: has-patch => has-patch needs-unit-tests
* focuses: => coding-standards
Comment:
For visibility as it looks like [https://github.com/WordPress/wordpress-
develop/pull/1780#pullrequestreview-790877840 PR reviews are not cross-
posted]:
> PR fixes the issue as described. ✅
>
> Two questions/remarks which are not directly related to this PR, but are
related to this code snippet:
> 1. Why is a closure being used here ? Closures can not be "unhooked", so
should never be used as a callback function in Core.
> 2. Why was this not caught be unit tests ? Or to rephrase: might it be a
good idea to add some unit tests covering this functionality ?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54323#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list