File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Http \Psr7Test ;
4
4
5
+ use F3 \Http \Factory \Psr17Factory as FatfreeFactory ;
5
6
use GuzzleHttp \Psr7 \Stream as GuzzleStream ;
6
7
use GuzzleHttp \Psr7 \UploadedFile as GuzzleUploadedFile ;
7
8
use GuzzleHttp \Psr7 \Uri as GuzzleUri ;
@@ -84,6 +85,10 @@ protected function buildUri($uri)
84
85
return new RingCentralUri ($ uri );
85
86
}
86
87
88
+ if (class_exists (FatfreeFactory::class)) {
89
+ return (new FatfreeFactory ())->createUri ($ uri );
90
+ }
91
+
87
92
throw new \RuntimeException ('Could not create URI. Check your config ' );
88
93
}
89
94
@@ -123,6 +128,9 @@ protected function buildStream($data)
123
128
if (class_exists (SlimStreamFactory::class)) {
124
129
$ factory = new SlimStreamFactory ();
125
130
}
131
+ if (class_exists (FatfreeFactory::class)) {
132
+ $ factory = new FatfreeFactory ();
133
+ }
126
134
if ($ factory ) {
127
135
if (is_string ($ data )) {
128
136
return $ factory ->createStream ($ data );
@@ -176,6 +184,12 @@ protected function buildUploadableFile($data)
176
184
return (new SlimUploadedFileFactory ())->createUploadedFile ($ stream );
177
185
}
178
186
187
+ if (class_exists (FatfreeFactory::class)) {
188
+ $ stream = $ this ->buildStream ($ data );
189
+
190
+ return (new FatfreeFactory ())->createUploadedFile ($ stream );
191
+ }
192
+
179
193
throw new \RuntimeException ('Could not create Stream. Check your config ' );
180
194
}
181
195
}
You can’t perform that action at this time.
0 commit comments