File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -167,21 +167,17 @@ public function quota(): array
167167 foreach ($ responses as $ response ) {
168168 $ tokens = $ response ->tokenAt (3 )->tokens ();
169169
170- // Tokens are expected to alternate between keys and values.
171- for ($ i = 0 ; $ i < count ($ tokens ); $ i += 3 ) {
172- $ type = $ tokens [$ i ]->value ;
173-
174- $ usage = (int ) $ tokens [$ i + 1 ]->value ;
175- $ limit = (int ) $ tokens [$ i + 2 ]->value ;
176-
177- if ($ type === 'STORAGE ' ) {
178- $ values ['usage ' ] = $ usage ;
179- $ values ['limit ' ] = $ limit ;
180- }
170+ $ type = $ tokens [0 ]->value ;
171+ $ usage = (int ) $ tokens [1 ]->value ;
172+ $ limit = (int ) $ tokens [2 ]->value ;
181173
182- $ values [$ type ]['usage ' ] = $ usage ;
183- $ values [$ type ]['limit ' ] = $ limit ;
174+ if ($ type === 'STORAGE ' ) {
175+ $ values ['usage ' ] = $ usage ;
176+ $ values ['limit ' ] = $ limit ;
184177 }
178+
179+ $ values [$ type ]['usage ' ] = $ usage ;
180+ $ values [$ type ]['limit ' ] = $ limit ;
185181 }
186182
187183 return $ values ;
You can’t perform that action at this time.
0 commit comments