repejota / phpnats

A PHP client for the NATSio cloud messaging system.

Home Page:http://nats.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Docblock specifies return type as resource

neilmcgibbon opened this issue · comments

In Connection.php, IDE complains as argument is of type \Closure, not resource. This might be a PHP version thing, but internal type \Closure has been supported since PHP 5.3

/**
     * Subscribes to an specific event given a subject.
     *
     * @param string   $subject  Message topic.
     * @param resource $callback Closure to be executed as callback.
     * @return string
     */
    public function subscribe($subject, $callback)

Should be:

/**
     * Subscribes to an specific event given a subject.
     *
     * @param string   $subject  Message topic.
     * @param \Closure $callback Closure to be executed as callback.
     * @return string
     */
    public function subscribe($subject, $callback)