public function getAllComments(string $type, int $typeId)
    {
        $type = strtolower($type);

        if (('project' !== $type && 'task' !== $type) || ! $this->validateId($typeId)) {
            return false;
        }

        $query  = http_build_query([$type . '_id' => $typeId], null, '&', PHP_QUERY_RFC3986);
        $result = $this->get('comments?' . $query);

        $status = $result->getStatusCode();
        if (204 === $status) {
            return [];
        }
        if (200 === $status) {
            return json_decode($result->getBody()->getContents());
        }

        return false;
    }
public function getAllComments(string $type, int $typeId)
    {
        $type = strtolower($type);

        if (('project' !== $type && 'task' !== $type) || ! $this->validateId($typeId)) {
            return false;
        }

        $query  = http_build_query([$type . '_id' => $typeId], null, '&', PHP_QUERY_RFC3986);
        $result = $this->get('comments?' . $query);

        $status = $result->getStatusCode();
        if (204 === $status) {
            return [];
        }
        if (200 === $status) {
            return json_decode($result->getBody()->getContents());
        }

        return false;
    }
public function getAllComments ( string $ type , int $ typeId ) { $ type = strtolower ( $ type ) ; if ( ( 'project' !== $ type && 'task' !== $ type ) || ! $ this -> validateId ( $ typeId ) ) { return false ; } $ query = http_build_query ( [ $ type . '_id' => $ typeId ] , null , '&' , PHP_QUERY_RFC3986 ) ; $ result = $ this -> get ( 'comments?' . $ query ) ; $ status = $ result -> getStatusCode ( ) ; if ( 204 === $ status ) { return [ ] ; } if ( 200 === $ status ) { return json_decode ( $ result -> getBody ( ) -> getContents ( ) ) ; } return false ; }
Get all comments.

@param string $type   Can be "project" or "task".
@param int    $typeId ID of the project/task.

@return array|bool Array with all comments (can be empty), or false on failure.
Get all comments .