Jump to content

Wrong function doc


Numbered

Recommended Posts

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

1.thumb.png.8e22272468c8ff532981604ea6610b65.png


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.

2.thumb.png.057939b20a474f02db7cecb120a6725f.png

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).

3.thumb.png.9fdff56c21658e1f1fe47a654260a6dd.png

 

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

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...