@@ -184,7 +184,7 @@ |
||
| 184 | 184 | |
| 185 | 185 | /** |
| 186 | 186 | * @param $object |
| 187 | - * @param $instance |
|
| 187 | + * @param FirebaseModel $instance |
|
| 188 | 188 | * @return object |
| 189 | 189 | */ |
| 190 | 190 | protected static function map($object, $instance) |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | public function save() |
| 114 | 114 | { |
| 115 | 115 | if (!empty($this->key)) { |
| 116 | - $response = $this->firebase->put(static::getNodeName() . '/' . $this->key, array( |
|
| 116 | + $response = $this->firebase->put(static::getNodeName().'/'.$this->key, array( |
|
| 117 | 117 | 'data' => $this->getData() |
| 118 | 118 | )); |
| 119 | 119 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | { |
| 133 | 133 | $success = false; |
| 134 | 134 | if (!empty($this->key)) { |
| 135 | - $response = $this->firebase->delete(static::getNodeName() . '/' . $this->key); |
|
| 135 | + $response = $this->firebase->delete(static::getNodeName().'/'.$this->key); |
|
| 136 | 136 | |
| 137 | 137 | $success = $response->success(); |
| 138 | 138 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | public static function findByKey($key, JCFirebase $firebase) |
| 150 | 150 | { |
| 151 | - $response = $firebase->get(static::getNodeName() . '/' . $key); |
|
| 151 | + $response = $firebase->get(static::getNodeName().'/'.$key); |
|
| 152 | 152 | $object = null; |
| 153 | 153 | if ($response->success() && $response->body() != 'null') { |
| 154 | 154 | $object = static::map($response->json(), new static()); |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | $jsonObject = json_decode($response->body(), true); |
| 173 | 173 | if ($response->success() && count($jsonObject)) { |
| 174 | 174 | do { |
| 175 | - $object = static::map((object)current($jsonObject), new static()); |
|
| 175 | + $object = static::map((object) current($jsonObject), new static()); |
|
| 176 | 176 | $object->key = key($jsonObject); |
| 177 | 177 | $object->firebase = $firebase; |
| 178 | 178 | $objects[] = $object; |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | protected static function map($object, $instance) |
| 191 | 191 | { |
| 192 | 192 | $mapper = new JsonMapper(); |
| 193 | - return $mapper->map((object)static::mapAttributes(get_object_vars($object), false), $instance); |
|
| 193 | + return $mapper->map((object) static::mapAttributes(get_object_vars($object), false), $instance); |
|
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | return static::fromJson($jsonString, $lifeTime); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - public static function getClient(){ |
|
| 63 | + public static function getClient() { |
|
| 64 | 64 | return Client::getClient(); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | throw new \Exception("firebase default path must contain /"); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - $pathURI = $this->firebaseURI . $this->rootPath . $path . ".json"; |
|
| 107 | + $pathURI = $this->firebaseURI.$this->rootPath.$path.".json"; |
|
| 108 | 108 | |
| 109 | 109 | //set query data |
| 110 | 110 | $queryData = array(); |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $queryData[Option::OPT_PRINT] = $print; |
| 113 | 113 | } |
| 114 | 114 | if (!empty($queryData)) { |
| 115 | - $pathURI = $pathURI . '?' . http_build_query($queryData); |
|
| 115 | + $pathURI = $pathURI.'?'.http_build_query($queryData); |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $this->refreshToken(); |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | public function getShallow($path = '', $options = array()) |
| 124 | 124 | { |
| 125 | 125 | return $this->client->get( |
| 126 | - $this->getPathURI($path) . '?' . http_build_query(array( |
|
| 126 | + $this->getPathURI($path).'?'.http_build_query(array( |
|
| 127 | 127 | Option::OPT_SHALLOW => 'true' |
| 128 | 128 | )), |
| 129 | 129 | $this->addDataToRequest($options), |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | |
| 221 | 221 | protected function refreshToken() |
| 222 | 222 | { |
| 223 | - $this->requestHeader['Authorization'] = 'Bearer ' . $this->auth->getAccessToken(); |
|
| 223 | + $this->requestHeader['Authorization'] = 'Bearer '.$this->auth->getAccessToken(); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | protected function addDataToPathURI($path = '', $options = array(), $reqType = RequestType::GET) |