File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1111 */
1212class StreamFactory
1313{
14- public static function create ($ content ): RequestStream
14+ public static function create ($ content, int $ preferredChunkSize = 64 * 1024 ): RequestStream
1515 {
1616 if (null === $ content || \is_string ($ content )) {
1717 return StringStream::create ($ content ?? '' );
1818 }
1919 if (\is_callable ($ content )) {
20- return CallableStream::create ($ content );
20+ return CallableStream::create ($ content, $ preferredChunkSize );
2121 }
2222 if (\is_iterable ($ content )) {
2323 return IterableStream::create ($ content );
2424 }
2525 if (\is_resource ($ content )) {
26- return ResourceStream::create ($ content );
26+ return ResourceStream::create ($ content, $ preferredChunkSize );
2727 }
2828
2929 throw new InvalidArgument (sprintf ('Unexpected content type "%s". ' , \is_object ($ content ) ? \get_class ($ content ) : \gettype ($ content )));
You can’t perform that action at this time.
0 commit comments