Skip to content

Commit 7739ff8

Browse files
committed
Add Adapter::removePullRequestSourceBranch()
1 parent 546945f commit 7739ff8

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

src/Adapter/Adapter.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,4 +369,13 @@ public function getReleaseAssets($id);
369369
* @throws AdapterException when deleting of release failed
370370
*/
371371
public function removeRelease($id);
372+
373+
/**
374+
* Deletes the remote source branch used in a pull request.
375+
*
376+
* @param int $id
377+
*
378+
* @return mixed
379+
*/
380+
public function removePullRequestSourceBranch($id);
372381
}

src/ThirdParty/Bitbucket/BitbucketRepoAdapter.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Gush\Adapter\BaseAdapter;
1515
use Gush\Exception\AdapterException;
16+
use Gush\Exception\UnsupportedOperationException;
1617
use Herrera\Version\Parser;
1718
use Herrera\Version\Validator as VersionValidator;
1819

@@ -519,4 +520,10 @@ protected function adaptPullRequestStructure(array $pr)
519520
],
520521
];
521522
}
523+
524+
public function removePullRequestSourceBranch($id)
525+
{
526+
/** @link https://developer.atlassian.com/static/rest/bitbucket-server/4.7.1/bitbucket-branch-rest.html#idp45632 REST Resources Provided By: Bitbucket Server - Branch */
527+
throw new UnsupportedOperationException('Bitbucket client "gentle/bitbucket-api" doesn\'t support references.');
528+
}
522529
}

tests/Fixtures/Adapter/TestAdapter.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,11 @@ public function createReleaseAssets($id, $name, $contentType, $content)
544544
return self::RELEASE_ASSET_NUMBER;
545545
}
546546

547+
public function removePullRequestSourceBranch($id)
548+
{
549+
return [];
550+
}
551+
547552
/**
548553
* {@inheritdoc}
549554
*/

0 commit comments

Comments
 (0)