@@ -43,6 +43,9 @@ |
||
| 43 | 43 | $this->setAuth($firebaseSerivceAccount); |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | + /** |
|
| 47 | + * @param string $firebaseServiceAccount |
|
| 48 | + */ |
|
| 46 | 49 | public function setAuth($firebaseServiceAccount){ |
| 47 | 50 | if(isset($firebaseServiceAccount['key']) && isset($firebaseServiceAccount['iss'])){ |
| 48 | 51 | $this->auth = new OAuth($firebaseServiceAccount['key'],$firebaseServiceAccount['iss']); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | protected function refreshToken() |
| 63 | 63 | { |
| 64 | - $this->requestHeader['Authorization'] = 'Bearer ' . $this->auth->getAccessToken(); |
|
| 64 | + $this->requestHeader['Authorization'] = 'Bearer '.$this->auth->getAccessToken(); |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | protected function mergeRequestPathURI($path = '', $options = array(), $reqType = JCFirebaseOption::REQ_TYPE_GET) |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | throw new \Exception("firebase default path must contain /"); |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | - $pathURI = $this->firebaseURI . $this->firebaseDefaultPath . $path . ".json"; |
|
| 100 | + $pathURI = $this->firebaseURI.$this->firebaseDefaultPath.$path.".json"; |
|
| 101 | 101 | |
| 102 | 102 | //set query data |
| 103 | 103 | $queryData = array(); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $queryData[JCFirebaseOption::OPTION_PRINT] = $print; |
| 106 | 106 | } |
| 107 | 107 | if (!empty($queryData)) { |
| 108 | - $pathURI = $pathURI . '?' . http_build_query($queryData); |
|
| 108 | + $pathURI = $pathURI.'?'.http_build_query($queryData); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | return $pathURI; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $this->refreshToken(); |
| 132 | 132 | |
| 133 | 133 | return Requests::get($this->getPathURI( |
| 134 | - $path) . '?' . http_build_query(array(JCFirebaseOption::OPTION_SHALLOW => JCFirebaseOption::SHALLOW_TRUE)), |
|
| 134 | + $path).'?'.http_build_query(array(JCFirebaseOption::OPTION_SHALLOW => JCFirebaseOption::SHALLOW_TRUE)), |
|
| 135 | 135 | $this->requestHeader, |
| 136 | 136 | $this->mergeRequestOptions($options) |
| 137 | 137 | ); |