You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our integrations directory we have all our classes that hook into WordPress filters and actions. As any exceptions thrown here in public functions wouldn't be able to be caught by us these would likely lead to fatals.
So ideally we'd be able to specify directories where throwing exceptions would be forbidden in public functions under the expectations that these would be hooked into WordPress filters ( if it's possible to detect which functions are hooked into filters or actions that would be excellent as well but I can see that being rather more difficult ).
So the following code would be forbidden only in public functions in a given directory:
thrownewException( "Error!" );
While the following would be allowed:
return false;
The text was updated successfully, but these errors were encountered:
if it's possible to detect which functions are hooked into filters or actions that would be excellent as well but I can see that being rather more difficult
If a function hook-in (add_filter()/add_action()) is always done in the same file as the function is declared in, this would be possible, but that would need to be a condition (which could be checked by a separate sniff).
In our integrations directory we have all our classes that hook into WordPress filters and actions. As any exceptions thrown here in public functions wouldn't be able to be caught by us these would likely lead to fatals.
So ideally we'd be able to specify directories where throwing exceptions would be forbidden in public functions under the expectations that these would be hooked into WordPress filters ( if it's possible to detect which functions are hooked into filters or actions that would be excellent as well but I can see that being rather more difficult ).
So the following code would be forbidden only in public functions in a given directory:
While the following would be allowed:
The text was updated successfully, but these errors were encountered: