File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 22
33namespace Http \Psr7Test ;
44
5+ use F3 \Http \Factory \Psr17Factory as FatfreeFactory ;
56use GuzzleHttp \Psr7 \Stream as GuzzleStream ;
67use GuzzleHttp \Psr7 \UploadedFile as GuzzleUploadedFile ;
78use GuzzleHttp \Psr7 \Uri as GuzzleUri ;
@@ -84,6 +85,10 @@ protected function buildUri($uri)
8485 return new RingCentralUri ($ uri );
8586 }
8687
88+ if (class_exists (FatfreeFactory::class)) {
89+ return (new FatfreeFactory ())->createUri ($ uri );
90+ }
91+
8792 throw new \RuntimeException ('Could not create URI. Check your config ' );
8893 }
8994
@@ -123,6 +128,9 @@ protected function buildStream($data)
123128 if (class_exists (SlimStreamFactory::class)) {
124129 $ factory = new SlimStreamFactory ();
125130 }
131+ if (class_exists (FatfreeFactory::class)) {
132+ $ factory = new FatfreeFactory ();
133+ }
126134 if ($ factory ) {
127135 if (is_string ($ data )) {
128136 return $ factory ->createStream ($ data );
@@ -176,6 +184,12 @@ protected function buildUploadableFile($data)
176184 return (new SlimUploadedFileFactory ())->createUploadedFile ($ stream );
177185 }
178186
187+ if (class_exists (FatfreeFactory::class)) {
188+ $ stream = $ this ->buildStream ($ data );
189+
190+ return (new FatfreeFactory ())->createUploadedFile ($ stream );
191+ }
192+
179193 throw new \RuntimeException ('Could not create Stream. Check your config ' );
180194 }
181195}
You can’t perform that action at this time.
0 commit comments