Jump to content


Wrong function doc


Recommended Posts

Hello. I have one of my application, which have this method:


As you can see my PhpStorm asks me to cast the array into the string, because of \IPS\Output::i()->json method wait string type as the first param.


But this is not true. This method (and json_encode function in order) accept an array as the primary usual incoming type. That fact that we can run json_encode('test') and got "test" as valid JSON result is just one behavior that is out if the usual scope for JSON using.
Another part of this method that we use 'return $this->sendOuput...' but this method doesn't return anything. So we can just use $this->sendOutput without return and declare the method as void.
If we jump inside 'stripVLETags' function inside of the json_decode method we can see that there have the same problem. Incoming wait for string, but ok to get an array and return a string (which is not true for incoming array).



This is not one place of something similar. The main reason why I create this ticket post is another question - is there any way to join your git project (I heard somewhere that you using svn, is that true?)? I (and I'm sure other people) easier to send the pull requests for you to fix these parts of code, fix bugs founded (following your rules, linters, markup, etc). It will be much more powerful than delivering these parts by the ticket with screenshots. I wouldn't waste a lot of time on that (if that not so critical and don't break my needs). I could just fix that in my IDE and make a pull request for your review. It would be very useful for all sides!

Thank you.

Link to comment
Share on other sites


  • Create New...

Important Information

We use technologies, such as cookies, to customise content and advertising, to provide social media features and to analyse traffic to the site. We also share information about your use of our site with our trusted social media, advertising and analytics partners. See more about cookies and our Privacy Policy