Remove unnecessary extra http client
[MAILPOET-2004]
This commit is contained in:
@ -22,9 +22,6 @@ class GitHubController {
|
|||||||
/** @var HttpClient */
|
/** @var HttpClient */
|
||||||
private $http_client;
|
private $http_client;
|
||||||
|
|
||||||
/** @var HttpClient */
|
|
||||||
private $http_client_no_base;
|
|
||||||
|
|
||||||
public function __construct($username, $token, $project) {
|
public function __construct($username, $token, $project) {
|
||||||
$this->zip_filename = $project === self::PROJECT_MAILPOET ? self::FREE_ZIP_FILENAME : self::PREMIUM_ZIP_FILENAME;
|
$this->zip_filename = $project === self::PROJECT_MAILPOET ? self::FREE_ZIP_FILENAME : self::PREMIUM_ZIP_FILENAME;
|
||||||
$github_path = $project === self::PROJECT_MAILPOET ? 'mailpoet' : 'mailpoet-premium';
|
$github_path = $project === self::PROJECT_MAILPOET ? 'mailpoet' : 'mailpoet-premium';
|
||||||
@ -35,12 +32,6 @@ class GitHubController {
|
|||||||
],
|
],
|
||||||
'base_uri' => "https://api.github.com/repos/mailpoet/$github_path/",
|
'base_uri' => "https://api.github.com/repos/mailpoet/$github_path/",
|
||||||
]);
|
]);
|
||||||
$this->http_client_no_base = new Client([
|
|
||||||
'auth' => [$username, $token],
|
|
||||||
'headers' => [
|
|
||||||
'Accept' => 'application/vnd.github.v3+json',
|
|
||||||
],
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createReleasePullRequest($version) {
|
public function createReleasePullRequest($version) {
|
||||||
@ -100,7 +91,7 @@ class GitHubController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function checkPullRequestChecks($statuses_url) {
|
private function checkPullRequestChecks($statuses_url) {
|
||||||
$response = $this->http_client_no_base->get($statuses_url);
|
$response = $this->http_client->get($statuses_url);
|
||||||
$response = json_decode($response->getBody()->getContents(), true);
|
$response = json_decode($response->getBody()->getContents(), true);
|
||||||
|
|
||||||
// Find checks. Statuses are returned in reverse chronological order. We need to get the first of each type
|
// Find checks. Statuses are returned in reverse chronological order. We need to get the first of each type
|
||||||
|
Reference in New Issue
Block a user