[wp-trac] [WordPress Trac] #37190: Split out function declarations and code executions.
WordPress Trac
noreply at wordpress.org
Thu Apr 23 05:23:14 UTC 2020
#37190: Split out function declarations and code executions.
-------------------------------+---------------------
Reporter: stephenharris | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+---------------------
Changes (by isabel_brison):
* keywords: => reporter-feedback
* type: defect (bug) => enhancement
* component: General => Build/Test Tools
Comment:
Thanks for reporting this @stephenharris . Could you specify which files
you found with mixed function declarations and code execution?
In the interests of not moving code around just for the sake of it, it
would be best to **only** move functions out when writing unit tests for
them. Also, in the the process of moving the function out, we'll need to:
* require_once at the top of the file they're used in for back-
compatibility
* potentially require_once elsewhere during bootstrapping.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37190#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list