User tests: Successful: Unsuccessful:
In legacy calls it is common to have the args as a string. So, if the first/second arg is not array, it should be proccessed as legacy.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
I fixed the link. Here is the comment:
I tend to say this PR isn't something we should do, as it is only a bandaid for faulty code in 3rd party extensions. It should be fixed in the respective extensions.
If we're going to do something like this, then it has to be deprecated right away with at least a log message. But then, the current warning is fine as the code still works and the extension developer gets notified of his faulty code right away. On productive servers, those warnings should be disabled anyway.
At least with the stylesheet
method, if the $options
argument were typehinted, this would be akin to removing the typehint and allowing any type. Both at 3.6.5 and 3.7.0 where the signatures were changed, that argument was always documented to require an array so any code passing in anything other than an array is Doing it Wrong™.
For the script
method, in 3.6.5 the second and third arguments were boolean then the refactoring made them arrays. Personally, I would change the API internals to throw an InvalidArgumentException
if those arguments are not of those types. Because this is again code that is Doing it Wrong™.
It is not our role as the API providers to cater to developers who are doing it wrong. Based on our documentation, that is what we should be coding for and any other condition is invalid use of the API.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-01-16 20:40:00 |
Closed_By | ⇒ | brianteeman |
See #15641. The final decision was to fix the faulty code that called this method.