\duncan3dc\GitHubPullRequest

Summary

Methods
Properties
Constants
request()
post()
put()
delete()
get()
getAll()
__construct()
getRepository()
getNumber()
getFiles()
getComments()
withCommit()
getCommit()
addComment()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
response()
getUrl()
$api
$repository
$number
$commit
N/A

Properties

$number

$number : integer

Type

integer — The unique ID of this pr.

$commit

$commit : string

Type

string — The version of this pr we are working with.

Methods

request()

request(\duncan3dc\GitHub\string  $method, \duncan3dc\GitHub\string  $url, array  $data = array()) 

Parameters

\duncan3dc\GitHub\string $method
\duncan3dc\GitHub\string $url
array $data

post()

post(string  $url, array  $data = array()) : \stdClass

Send a POST request and return the response.

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

Returns

\stdClass

put()

put(string  $url, array  $data = array()) : \stdClass

Send a PUT request and return the response.

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

Returns

\stdClass

delete()

delete(string  $url, array  $data = array()) : \stdClass

Send a DELETE request and return the response.

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

Returns

\stdClass

get()

get(string  $url, array  $data = array()) : \stdClass

Send a GET request and return the response.

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

Returns

\stdClass

getAll()

getAll(string  $url, array  $data = array(), callable  $callback = null) : \Traversable|array<mixed,\stdClass>

Send a GET request and return the response.

This method will loop through all the pages until one returns no results

Parameters

string $url

The url to issue the request to

array $data

The parameters to send with the request

callable $callback

An optional handler to yield items via

Returns

\Traversable|array<mixed,\stdClass>

__construct()

__construct(\duncan3dc\GitHub\RepositoryInterface  $repository, integer  $number, \duncan3dc\GitHub\ApiInterface  $api) 

Create a new instance.

Parameters

\duncan3dc\GitHub\RepositoryInterface $repository

The repository this pr is part of

integer $number

The unique ID of this pr

\duncan3dc\GitHub\ApiInterface $api

The Api instance to communicate with GitHub.

getNumber()

getNumber() : integer

Get the number of this pr.

Returns

integer

getFiles()

getFiles() : \duncan3dc\GitHub\iterable|array<mixed,\stdClass>

Get all the files that are touched by this pr.

Returns

\duncan3dc\GitHub\iterable|array<mixed,\stdClass>

getComments()

getComments() : \duncan3dc\GitHub\iterable|array<mixed,\stdClass>

Get all the comments on this pr.

Returns

\duncan3dc\GitHub\iterable|array<mixed,\stdClass>

withCommit()

withCommit(\duncan3dc\GitHub\string  $commit) : \duncan3dc\GitHub\PullRequestInterface

Set the version of this pr we are working with.

Parameters

\duncan3dc\GitHub\string $commit

The full sha of the commit in the pr

Returns

\duncan3dc\GitHub\PullRequestInterface

getCommit()

getCommit() : string

Get the version of this pr we are working with.

Returns

string

addComment()

addComment(\duncan3dc\GitHub\string  $comment, \duncan3dc\GitHub\string  $path, \duncan3dc\GitHub\int  $position) : void

Add a comment to the pr.

Parameters

\duncan3dc\GitHub\string $comment
\duncan3dc\GitHub\string $path
\duncan3dc\GitHub\int $position

response()

response(\Psr\Http\Message\ResponseInterface  $response) : \stdClass

Convert a response into a simple object.

Parameters

\Psr\Http\Message\ResponseInterface $response

The response to convert

Returns

\stdClass

getUrl()

getUrl(string  $path) : string

Generate a url using this pull request as the base.

Parameters

string $path

The path underneath this pull request to hit

Returns

string