Skip to content

Commit 8b0ebae

Browse files
committed
Use constants instead of properties for BitBucket URLs
1 parent 2a649be commit 8b0ebae

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

SourceBitBucket/SourceBitBucket.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ class SourceBitBucketPlugin extends MantisSourceGitBasePlugin {
1717
*/
1818
const ERROR_BITBUCKET_API = 'bitbucket_api';
1919

20-
protected $main_url = "https://bitbucket.org/";
21-
protected $api_url = 'https://bitbucket.org/api/2.0/';
20+
/**
21+
* BitBucket URLs
22+
*/
23+
const URL_MAIN = "https://bitbucket.org/";
24+
const URL_API = self::URL_MAIN . 'api/2.0/';
2225

2326
public $type = 'bb';
2427

@@ -60,7 +63,7 @@ public function show_file( $p_repo, $p_changeset, $p_file ) {
6063
}
6164

6265
public function url_base( $p_repo ) {
63-
return $this->main_url . $p_repo->info['bit_username'] . '/' . $p_repo->info['bit_reponame'];
66+
return self::URL_MAIN . $p_repo->info['bit_username'] . '/' . $p_repo->info['bit_reponame'];
6467
}
6568

6669
public function url_repo( $p_repo, $p_changeset = null ) {
@@ -215,7 +218,7 @@ public function update_repo( $p_repo ) {
215218
}
216219

217220
private function api_url( $p_path ) {
218-
return $this->api_url . $p_path;
221+
return self::URL_API . $p_path;
219222
}
220223

221224
private function api_json_url( $p_repo, $p_url ) {

0 commit comments

Comments
 (0)