Skip to content

Commit ff6e248

Browse files
authored
Support stable psr/http-factory (#27)
1 parent b1a6385 commit ff6e248

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/BaseTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ protected function buildUri($uri)
3030
if ($factory instanceof \Http\Message\UriFactory) {
3131
return $factory->createUri($uri);
3232
}
33-
if ($factory instanceof \Interop\Http\Factory\UriFactoryInterface) {
33+
if ($factory instanceof \Psr\Http\Message\UriFactoryInterface) {
3434
if ($uri instanceof UriInterface) {
3535
return $uri;
3636
}
3737

3838
return $factory->createUri($uri);
3939
}
4040

41-
throw new \RuntimeException('Constant "URI_FACTORY" must be a reference to a Http\Message\UriFactory or \Interop\Http\Factory\UriFactoryInterface');
41+
throw new \RuntimeException('Constant "URI_FACTORY" must be a reference to a Http\Message\UriFactory or \Psr\Http\Message\UriFactoryInterface');
4242
}
4343

4444
if (class_exists(GuzzleUri::class)) {
@@ -64,15 +64,15 @@ protected function buildStream($data)
6464
if ($factory instanceof \Http\Message\StreamFactory) {
6565
return $factory->createStream($data);
6666
}
67-
if ($factory instanceof \Interop\Http\Factory\StreamFactoryInterface) {
67+
if ($factory instanceof \Psr\Http\Message\StreamFactoryInterface) {
6868
if (is_string($data)) {
6969
return $factory->createStream($data);
7070
} else {
7171
return $factory->createStreamFromResource($data);
7272
}
7373
}
7474

75-
throw new \RuntimeException('Constant "STREAM_FACTORY" must be a reference to a Http\Message\StreamFactory or \Interop\Http\Factory\StreamFactoryInterface');
75+
throw new \RuntimeException('Constant "STREAM_FACTORY" must be a reference to a Http\Message\StreamFactory or \Psr\Http\Message\StreamFactoryInterface');
7676
}
7777

7878
if (class_exists(GuzzleStream::class)) {
@@ -91,8 +91,8 @@ protected function buildUploadableFile($data)
9191
if (defined('UPLOADED_FILE_FACTORY')) {
9292
$factoryClass = UPLOADED_FILE_FACTORY;
9393
$factory = new $factoryClass();
94-
if (!$factory instanceof \Interop\Http\Factory\UploadedFileFactoryInterface) {
95-
throw new \RuntimeException('Constant "UPLOADED_FILE_FACTORY" must be a reference to a Interop\Http\Factory\UploadedFileFactoryInterface');
94+
if (!$factory instanceof \Psr\Http\Message\UploadedFileFactoryInterface) {
95+
throw new \RuntimeException('Constant "UPLOADED_FILE_FACTORY" must be a reference to a Psr\Http\Message\UploadedFileFactoryInterface');
9696
}
9797

9898
$stream = $this->buildStream($data);

0 commit comments

Comments
 (0)