@@ -10,33 +10,33 @@ |
||
10 | 10 | |
11 | 11 | |
12 | 12 | class Option { |
13 | - const __default = null; |
|
14 | - |
|
15 | - const OPTION_SHALLOW = 'shallow'; |
|
16 | - const SHALLOW_TRUE = 'true'; |
|
17 | - const SHALLOW_FALSE = 'false'; |
|
18 | - |
|
19 | - const OPTION_PRINT = 'print'; |
|
20 | - const PRINT_PRETTY = 'pretty'; |
|
21 | - const PRINT_SILENT = 'silent'; |
|
22 | - |
|
23 | - const REQ_TYPE_GET = 0; |
|
24 | - const REQ_TYPE_PUT = 1; |
|
25 | - const REQ_TYPE_POST = 2; |
|
26 | - const REQ_TYPE_PATCH = 3; |
|
27 | - const REQ_TYPE_DELETE = 4; |
|
28 | - |
|
29 | - public static function isAllowPrint( $reqType = self::REQ_TYPE_GET, $pType = self::PRINT_PRETTY ) { |
|
30 | - if ( $pType == self::PRINT_PRETTY ) { |
|
31 | - return true; |
|
32 | - } |
|
33 | - |
|
34 | - if ( $pType == self::PRINT_SILENT ) { |
|
35 | - if ( $reqType == self::REQ_TYPE_DELETE ) { |
|
36 | - return false; |
|
37 | - } |
|
38 | - } |
|
39 | - |
|
40 | - return true; |
|
41 | - } |
|
13 | + const __default = null; |
|
14 | + |
|
15 | + const OPTION_SHALLOW = 'shallow'; |
|
16 | + const SHALLOW_TRUE = 'true'; |
|
17 | + const SHALLOW_FALSE = 'false'; |
|
18 | + |
|
19 | + const OPTION_PRINT = 'print'; |
|
20 | + const PRINT_PRETTY = 'pretty'; |
|
21 | + const PRINT_SILENT = 'silent'; |
|
22 | + |
|
23 | + const REQ_TYPE_GET = 0; |
|
24 | + const REQ_TYPE_PUT = 1; |
|
25 | + const REQ_TYPE_POST = 2; |
|
26 | + const REQ_TYPE_PATCH = 3; |
|
27 | + const REQ_TYPE_DELETE = 4; |
|
28 | + |
|
29 | + public static function isAllowPrint( $reqType = self::REQ_TYPE_GET, $pType = self::PRINT_PRETTY ) { |
|
30 | + if ( $pType == self::PRINT_PRETTY ) { |
|
31 | + return true; |
|
32 | + } |
|
33 | + |
|
34 | + if ( $pType == self::PRINT_SILENT ) { |
|
35 | + if ( $reqType == self::REQ_TYPE_DELETE ) { |
|
36 | + return false; |
|
37 | + } |
|
38 | + } |
|
39 | + |
|
40 | + return true; |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | \ No newline at end of file |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | throw new \Exception("firebase default path must contain /"); |
118 | 118 | } |
119 | 119 | |
120 | - $pathURI = $this->firebaseURI . $this->firebaseDefaultPath . $path . ".json"; |
|
120 | + $pathURI = $this->firebaseURI.$this->firebaseDefaultPath.$path.".json"; |
|
121 | 121 | |
122 | 122 | //set query data |
123 | 123 | $queryData = array(); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $queryData[Option::OPTION_PRINT] = $print; |
126 | 126 | } |
127 | 127 | if (!empty($queryData)) { |
128 | - $pathURI = $pathURI . '?' . http_build_query($queryData); |
|
128 | + $pathURI = $pathURI.'?'.http_build_query($queryData); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | $this->refreshToken(); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function getShallow($path = '', $options = array()) |
137 | 137 | { |
138 | 138 | return Requests::get( |
139 | - $this->getPathURI($path) . '?' . http_build_query(array( |
|
139 | + $this->getPathURI($path).'?'.http_build_query(array( |
|
140 | 140 | Option::OPTION_SHALLOW => Option::SHALLOW_TRUE |
141 | 141 | )), |
142 | 142 | $this->requestHeader, |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | |
209 | 209 | protected function refreshToken() |
210 | 210 | { |
211 | - $this->requestHeader['Authorization'] = 'Bearer ' . $this->auth->getAccessToken(); |
|
211 | + $this->requestHeader['Authorization'] = 'Bearer '.$this->auth->getAccessToken(); |
|
212 | 212 | } |
213 | 213 | |
214 | 214 | protected function addDataToPathURI($path = '', $options = array(), $reqType = Option::REQ_TYPE_GET) |