File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed
Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ public function select(bool $force = false): void
155155 $ this ->mailbox ->select ($ this , $ force );
156156 }
157157
158- /**
158+ /**
159159 * {@inheritDoc}
160160 */
161161 public function quota (): array
@@ -169,21 +169,18 @@ public function quota(): array
169169 $ values = [];
170170
171171 foreach ($ responses as $ response ) {
172- $ tokens = $ response ->tokenAt (3 )-> tokens ( );
172+ $ resource = $ response ->tokenAt (2 );
173173
174- $ type = $ tokens [0 ]->value ;
175- $ usage = (int ) $ tokens [1 ]->value ;
176- $ limit = (int ) $ tokens [2 ]->value ;
174+ $ tokens = $ response ->tokenAt (3 )->tokens ();
177175
178- if ($ type === 'STORAGE ' ) {
179- $ values ['usage ' ] = $ usage ;
180- $ values ['limit ' ] = $ limit ;
176+ for ($ i = 0 ; $ i + 2 < count ($ tokens ); $ i += 3 ) {
177+ $ values [$ resource ->value ][$ tokens [$ i ]->value ] = [
178+ 'usage ' => (int ) $ tokens [$ i + 1 ]->value ,
179+ 'limit ' => (int ) $ tokens [$ i + 2 ]->value ,
180+ ];
181181 }
182-
183- $ values [$ type ]['usage ' ] = $ usage ;
184- $ values [$ type ]['limit ' ] = $ limit ;
185182 }
186-
183+
187184 return $ values ;
188185 }
189186
You can’t perform that action at this time.
0 commit comments