33
33
use CBOR \Tag \UnsignedBigIntegerTag ;
34
34
use CBOR \Tag \UriTag ;
35
35
use InvalidArgumentException ;
36
- use function ord ;
37
36
use RuntimeException ;
37
+ use function ord ;
38
38
use const STR_PAD_LEFT ;
39
39
40
40
final class Decoder implements DecoderInterface
@@ -150,7 +150,7 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR
150
150
}
151
151
152
152
return $ object ;
153
- case CBORObject::MAJOR_TYPE_TEXT_STRING : //3
153
+ case CBORObject::MAJOR_TYPE_TEXT_STRING : //3
154
154
$ object = IndefiniteLengthTextStringObject::create ();
155
155
while (! ($ it = $ this ->process ($ stream , true )) instanceof BreakObject) {
156
156
if (! $ it instanceof TextStringObject) {
@@ -162,7 +162,7 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR
162
162
}
163
163
164
164
return $ object ;
165
- case CBORObject::MAJOR_TYPE_LIST : //4
165
+ case CBORObject::MAJOR_TYPE_LIST : //4
166
166
$ object = IndefiniteLengthListObject::create ();
167
167
$ it = $ this ->process ($ stream , true );
168
168
while (! $ it instanceof BreakObject) {
@@ -171,23 +171,23 @@ private function processInfinite(Stream $stream, int $mt, bool $breakable): CBOR
171
171
}
172
172
173
173
return $ object ;
174
- case CBORObject::MAJOR_TYPE_MAP : //5
174
+ case CBORObject::MAJOR_TYPE_MAP : //5
175
175
$ object = IndefiniteLengthMapObject::create ();
176
176
while (! ($ it = $ this ->process ($ stream , true )) instanceof BreakObject) {
177
177
$ object ->add ($ it , $ this ->process ($ stream , false ));
178
178
}
179
179
180
180
return $ object ;
181
- case CBORObject::MAJOR_TYPE_OTHER_TYPE : //7
181
+ case CBORObject::MAJOR_TYPE_OTHER_TYPE : //7
182
182
if (! $ breakable ) {
183
183
throw new InvalidArgumentException ('Cannot parse the data. No enclosing indefinite. ' );
184
184
}
185
185
186
186
return BreakObject::create ();
187
- case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER : //0
188
- case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER : //1
189
- case CBORObject::MAJOR_TYPE_TAG : //6
190
- default :
187
+ case CBORObject::MAJOR_TYPE_UNSIGNED_INTEGER : //0
188
+ case CBORObject::MAJOR_TYPE_NEGATIVE_INTEGER : //1
189
+ case CBORObject::MAJOR_TYPE_TAG : //6
190
+ default :
191
191
throw new InvalidArgumentException (sprintf (
192
192
'Cannot parse the data. Found infinite length for Major Type "%s" (%d). ' ,
193
193
str_pad (decbin ($ mt ), 5 , '0 ' , STR_PAD_LEFT ),
0 commit comments