@@ -8,8 +8,8 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace JCFirebase\Models; |
| 10 | 10 | |
| 11 | -use JsonMapper; |
|
| 12 | 11 | use JCFirebase\JCFirebase; |
| 12 | +use JsonMapper; |
|
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * Class FirebaseModel |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | public function save() |
| 82 | 82 | { |
| 83 | 83 | if (!empty($this->key)) { |
| 84 | - $response = $this->firebase->put(self::getNodeName() . '/' . $this->key, array( |
|
| 84 | + $response = $this->firebase->put(self::getNodeName().'/'.$this->key, array( |
|
| 85 | 85 | 'data' => $this->getData() |
| 86 | 86 | )); |
| 87 | 87 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | { |
| 101 | 101 | $success = false; |
| 102 | 102 | if (!empty($this->key)) { |
| 103 | - $response = $this->firebase->delete(self::getNodeName() . '/' . $this->key); |
|
| 103 | + $response = $this->firebase->delete(self::getNodeName().'/'.$this->key); |
|
| 104 | 104 | |
| 105 | 105 | $success = $response->success(); |
| 106 | 106 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public static function findByKey($key, JCFirebase $firebase) |
| 118 | 118 | { |
| 119 | - $response = $firebase->get(self::getNodeName() . '/' . $key); |
|
| 119 | + $response = $firebase->get(self::getNodeName().'/'.$key); |
|
| 120 | 120 | $object = null; |
| 121 | 121 | if ($response->success() && $response->body() != 'null') { |
| 122 | 122 | $mapper = new JsonMapper(); |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | if ($response->success() && count($jsonObject)) { |
| 143 | 143 | do { |
| 144 | 144 | $mapper = new JsonMapper(); |
| 145 | - $object = $mapper->map((object)current($jsonObject), new static()); |
|
| 145 | + $object = $mapper->map((object) current($jsonObject), new static()); |
|
| 146 | 146 | $object->key = key($jsonObject); |
| 147 | 147 | $object->firebase = $firebase; |
| 148 | 148 | $objects[] = $object; |
@@ -8,10 +8,10 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace JCFirebase; |
| 10 | 10 | |
| 11 | +use JCFirebase\Enums\PrintType; |
|
| 12 | +use JCFirebase\Enums\RequestType; |
|
| 11 | 13 | use JC\JCRequest; |
| 12 | 14 | use JC\JCResponse; |
| 13 | -use JCFirebase\Enums\RequestType; |
|
| 14 | -use JCFirebase\Enums\PrintType; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Class JCFirebase |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | throw new \Exception("firebase default path must contain /"); |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - $pathURI = $this->firebaseURI . $this->rootPath . $path . ".json"; |
|
| 117 | + $pathURI = $this->firebaseURI.$this->rootPath.$path.".json"; |
|
| 118 | 118 | |
| 119 | 119 | //set query data |
| 120 | 120 | $queryData = array(); |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $queryData[Option::_PRINT] = $print; |
| 123 | 123 | } |
| 124 | 124 | if (!empty($queryData)) { |
| 125 | - $pathURI = $pathURI . '?' . http_build_query($queryData); |
|
| 125 | + $pathURI = $pathURI.'?'.http_build_query($queryData); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | $this->refreshToken(); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | public function getShallow($path = '', $options = array()) |
| 134 | 134 | { |
| 135 | 135 | return JCRequest::get( |
| 136 | - $this->getPathURI($path) . '?' . http_build_query(array( |
|
| 136 | + $this->getPathURI($path).'?'.http_build_query(array( |
|
| 137 | 137 | Option::_SHALLOW => 'true' |
| 138 | 138 | )), |
| 139 | 139 | $this->addDataToRequest($options), |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | |
| 231 | 231 | protected function refreshToken() |
| 232 | 232 | { |
| 233 | - $this->requestHeader['Authorization'] = 'Bearer ' . $this->auth->getAccessToken(); |
|
| 233 | + $this->requestHeader['Authorization'] = 'Bearer '.$this->auth->getAccessToken(); |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | protected function addDataToPathURI($path = '', $options = array(), $reqType = RequestType::GET) |