Skip to content

Commit

Permalink
B2: Increase visibility to allow subclassing (#504)
Browse files Browse the repository at this point in the history
Promoting the private methods to protected methods makes it easier to subclass the storage adapter to implement your own naming scheme.
  • Loading branch information
matslindh authored and christeredvartsen committed Nov 10, 2016
1 parent 44efd87 commit 65f18a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Storage/B2.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function imageExists($user, $imageIdentifier) {
/**
* Get the current B2 client
*/
private function getClient() {
protected function getClient() {
if ($this->client === null) {
$this->client = new Client($this->getParam('accountId'), $this->getParam('applicationKey'));
}
Expand All @@ -187,7 +187,7 @@ private function getClient() {
/**
* Get a parameter
*/
private function getParam($param) {
protected function getParam($param) {
if (!isset($this->params[$param])) {
throw new InvalidArgumentException('Attempted to read invalid parameter', 500);
}
Expand All @@ -202,7 +202,7 @@ private function getParam($param) {
* @param string $imageIdentifier Image identifier
* @return string
*/
private function getImagePath($user, $imageIdentifier) {
protected function getImagePath($user, $imageIdentifier) {
return $user . '/' . $imageIdentifier;
}
}

0 comments on commit 65f18a6

Please sign in to comment.