Coder Social home page Coder Social logo

Comments (9)

themattharris avatar themattharris commented on July 29, 2024

try adding this line to the top of the tmhOAuth class.
var $response = array();

so tmhOAuth.php will start something like:

class tmhOAuth {
  const VERSION = 0.621;

  var $response = array();
  /**
   * Creates a new tmhOAuth object
   *
   * @param string $config, the configuration to use for this request
   */
  function __construct($config) {

if that solves the issue let me know.

from tmhoauth.

trante avatar trante commented on July 29, 2024

Thank you. Warnings for response were disappeared.

But still IDE complains about request.
$code=$tmhOAuth->request('GET', $tmhOAuth->url('1/account/totals') );
Warning: 'void' method 'request' result used

I suppose this warning is IDE's bug?

from tmhoauth.

trante avatar trante commented on July 29, 2024

"request" function's warnings are solved when i changed phpDoc of function.
Return tag, from void to int.
Is "void" word typo there ?
Thank you

/**

  • Makes a curl request. Takes no parameters as all should have been prepared
  • by the request method
    *
  • @return int response data is stored in the class variable 'response'
    */

from tmhoauth.

themattharris avatar themattharris commented on July 29, 2024

interesting, to be honest i should review those phpdocs. i don't use an IDE which reads them so these ommissions are generally obscured from me.
thanks for sharing your findings.

from tmhoauth.

trante avatar trante commented on July 29, 2024

Thank you for help.

from tmhoauth.

trante avatar trante commented on July 29, 2024

Hello, is there a change about this:
#47 (comment)

tmhouath->request has no "return" parameter in phpDoc.
Also in document it is written that function "Make an HTTP request using this library. This method doesn't return anything."
But we can get integer status code with $code=$tmhOAuth->request(...)
Which gives warning inside IDE.

All errors are suppressed when I add:
* @return int
to the phpdoc of request function.
But I think it should be added to commited version?
Or do I miss something?

from tmhoauth.

trante avatar trante commented on July 29, 2024

My IDE says that both of these two methods are defined as "returns void" inside PHPdoc. But when I use them I get $code as output. So my IDE gives warning. Everytime I download a newer tmhoauth version, I add @return int to the top of each function.
public function request($method, $url, $params=array(), $useauth=true, $multipart=false, $headers=array()) private function curlit()

from tmhoauth.

themattharris avatar themattharris commented on July 29, 2024

thanks. the PHPDoc got left behind when extra features were added. fixing that up now

from tmhoauth.

themattharris avatar themattharris commented on July 29, 2024

fixed in 0.7.3 and shipped

from tmhoauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.