@@ -24,25 +24,23 @@ public static function getJsonFromResponse(ResponseInterface $response): mixed
2424 }
2525
2626 /**
27- * @param array{size?: int, metadata?: mixed[], mode?: bool, seekable?: bool } $options
27+ * @param array{size?: int, metadata?: mixed[]} $options
2828 */
2929 public static function streamFor (string $ resource = '' , array $ options = []): Stream
3030 {
31- if (is_scalar ($ resource )) {
32- $ stream = fopen ('php://temp ' , 'r+ ' );
33- if ($ resource !== '' && $ stream ) {
34- fwrite ($ stream , $ resource );
35- fseek ($ stream , 0 );
36-
37- return new Stream ($ stream , $ options );
38- }
31+ $ stream = fopen ('php://temp ' , 'r+ ' );
32+ if ($ resource !== '' && $ stream ) {
33+ fwrite ($ stream , $ resource );
34+ fseek ($ stream , 0 );
35+
36+ return new Stream ($ stream , $ options );
3937 }
4038
4139 throw new InvalidArgumentException ('Invalid resource type: ' . gettype ($ resource ));
4240 }
4341
4442 /**
45- * @param int<1, max > $depth
43+ * @param int<1, 2147483647 > $depth
4644 */
4745 public static function jsonEncode (mixed $ value , int $ options = 0 , int $ depth = 512 ): string
4846 {
@@ -55,7 +53,7 @@ public static function jsonEncode(mixed $value, int $options = 0, int $depth = 5
5553 }
5654
5755 /**
58- * @param int<1, max > $depth
56+ * @param int<1, 2147483647 > $depth
5957 */
6058 public static function jsonDecode (string $ json , bool $ assoc = false , int $ depth = 512 , int $ options = 0 ): mixed
6159 {
@@ -69,7 +67,7 @@ public static function jsonDecode(string $json, bool $assoc = false, int $depth
6967
7068 public static function createStream (mixed $ content ): StreamInterface
7169 {
72- return Utils ::streamFor (Utils ::jsonEncode ($ content ));
70+ return self ::streamFor (self ::jsonEncode ($ content ));
7371 }
7472
7573 /**
0 commit comments