You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for PHPUnit10 and remove support for PHPUnit8
* Normalize class import and class alias
* Remove PHP7.2 from github workflows
* Migrate phpunit.xml.dist configuration file
* Using FQN for PSR interfaces
@@ -36,18 +42,18 @@ protected function buildUri($uri)
36
42
if (defined('URI_FACTORY')) {
37
43
$factoryClass = URI_FACTORY;
38
44
$factory = new$factoryClass();
39
-
if ($factoryinstanceof\Http\Message\UriFactory) {
45
+
if ($factoryinstanceofHttplugUriFactory) {
40
46
return$factory->createUri($uri);
41
47
}
42
-
if ($factoryinstanceof\Psr\Http\Message\UriFactoryInterface) {
43
-
if ($uriinstanceofUriInterface) {
48
+
if ($factoryinstanceofPsrUriFactoryInterface) {
49
+
if ($uriinstanceofPsrUriInterface) {
44
50
return$uri;
45
51
}
46
52
47
53
return$factory->createUri($uri);
48
54
}
49
55
50
-
thrownew \RuntimeException('Constant "URI_FACTORY" must be a reference to a Http\Message\UriFactory or \Psr\Http\Message\UriFactoryInterface');
56
+
thrownew \RuntimeException('Constant "URI_FACTORY" must be a reference to a '.HttplugUriFactory::class.' or '.PsrUriFactoryInterface::class);
51
57
}
52
58
53
59
if (class_exists(HttpSoftUri::class)) {
@@ -86,22 +92,22 @@ protected function buildStream($data)
86
92
if (defined('STREAM_FACTORY')) {
87
93
$factoryClass = STREAM_FACTORY;
88
94
$factory = new$factoryClass();
89
-
if ($factoryinstanceof\Http\Message\StreamFactory) {
95
+
if ($factoryinstanceofHttplugStreamFactory) {
90
96
return$factory->createStream($data);
91
97
}
92
-
if ($factoryinstanceof\Psr\Http\Message\StreamFactoryInterface) {
98
+
if ($factoryinstanceofPsrStreamFactoryInterface) {
93
99
if (is_string($data)) {
94
100
return$factory->createStream($data);
95
101
}
96
102
97
103
return$factory->createStreamFromResource($data);
98
104
}
99
105
100
-
thrownew \RuntimeException('Constant "STREAM_FACTORY" must be a reference to a Http\Message\StreamFactory or \Psr\Http\Message\StreamFactoryInterface');
106
+
thrownew \RuntimeException('Constant "STREAM_FACTORY" must be a reference to a '.HttplugStreamFactory::class.' or '.PsrStreamFactoryInterface::class);
101
107
}
102
108
103
109
if (class_exists(GuzzleStream::class)) {
104
-
return\GuzzleHttp\Psr7\Utils::streamFor($data);
110
+
returnGuzzleUtils::streamFor($data);
105
111
}
106
112
107
113
$factory = null;
@@ -137,8 +143,8 @@ protected function buildUploadableFile($data)
137
143
if (defined('UPLOADED_FILE_FACTORY')) {
138
144
$factoryClass = UPLOADED_FILE_FACTORY;
139
145
$factory = new$factoryClass();
140
-
if (!$factoryinstanceof\Psr\Http\Message\UploadedFileFactoryInterface) {
141
-
thrownew \RuntimeException('Constant "UPLOADED_FILE_FACTORY" must be a reference to a Psr\Http\Message\UploadedFileFactoryInterface');
146
+
if (!$factoryinstanceofPsrUploadedFileFactoryInterface) {
147
+
thrownew \RuntimeException('Constant "UPLOADED_FILE_FACTORY" must be a reference to a '.PsrUploadedFileFactoryInterface::class);
0 commit comments