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
Since this package is designed to fit into a WordPress-envoirment, Exceptions could lead to broken sites (WordPress does not handle Exceptions by default).
Exception in set_options
Maybe we should change the behavior of set_options from throwing an InvalidArgumentException to a more "wordpressy"-way by using _doing_it_wrong() and not setting the given configuration to the $options-array.
Usage of _doing_it_wrong in Inpsyde\Filter\WordPress
The other point which has to be discussed is the _doing_it_wrong in Inpsyde\Filter\WordPress folder, when a incorrect $value-type is given. I think just returning the value and triggering a _doing_it_wrong seems to be ok, since WordPress does nothing (no error message, just continue with something similar or even break) against wrong values.
The text was updated successfully, but these errors were encountered:
Do you really want to bind all these nice logic to a WordPress-only content? The question is, whether you want to force developers to deal with this exceptions. For what I see, the most exceptions are about logical errors, meaning these should lead directly to a change in the client code.
However, maybe it's somehow possible to handle the exceptions internally of Inpsyde\Filters within a wrapper that then delegates these exceptions to _doing_it_wrong().
I like the "throw Exception if something is not correct"-approach. The "wordpressy"-way is too soft, hard to debug and not really secure ("oh something wrong is given..no problem, i just continue with something similar/else"). WordPress does not stop the program when something is really incorrect.
Since this package is designed to fit into a WordPress-envoirment, Exceptions could lead to broken sites (WordPress does not handle Exceptions by default).
Exception in set_options
Maybe we should change the behavior of
set_options
from throwing anInvalidArgumentException
to a more "wordpressy"-way by using_doing_it_wrong()
and not setting the given configuration to the$options
-array.Usage of
_doing_it_wrong
inInpsyde\Filter\WordPress
The other point which has to be discussed is the
_doing_it_wrong
inInpsyde\Filter\WordPress
folder, when a incorrect$value
-type is given. I think just returning the value and triggering a_doing_it_wrong
seems to be ok, since WordPress does nothing (no error message, just continue with something similar or even break) against wrong values.The text was updated successfully, but these errors were encountered: