Gush\ThirdParty\Bitbucket\BitbucketRepoAdapter::openPullRequest PHP Метод

openPullRequest() публичный Метод

public openPullRequest ( $base, $head, $subject, $body, array $parameters = [] )
$parameters array
    public function openPullRequest($base, $head, $subject, $body, array $parameters = [])
    {
        list($sourceOrg, $sourceBranch) = explode(':', $head, 2);
        $params = ['title' => $subject, 'description' => $body, 'source' => ['branch' => ['name' => $sourceBranch]], 'destination' => ['branch' => ['name' => $base]]];
        if ($sourceOrg !== $this->getUsername()) {
            $params['source']['repository'] = ['full_name' => $sourceOrg . '/' . $this->getRepository()];
        }
        $response = $this->client->apiPullRequests()->create($this->getUsername(), $this->getRepository(), $params);
        $resultArray = json_decode($response->getContent(), true);
        return ['html_url' => $resultArray['links']['html']['href'], 'number' => $resultArray['id']];
    }