Skip to content

Commit 9b38270

Browse files
authored
Merge pull request #152 from nicolas-grekas/drop-httplg-factory
Remove direct dependency on php-http/message-factory
2 parents 2a1fbaa + b7cdf17 commit 9b38270

11 files changed

+41
-1
lines changed

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file.
66
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
77
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
88

9+
## [1.16.0] - 2023-XX-XX
10+
11+
- Remove direct dependency on php-http/message-factory
12+
913
## [1.15.0] - 2023-05-10
1014

1115
**If you use the decorator classes, you might need to adjust your code to the parameter and return type declarations added in PSR-7**

Diff for: composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"require": {
1818
"php": "^7.2 || ^8.0",
1919
"clue/stream-filter": "^1.5",
20-
"php-http/message-factory": "^1.0.2",
2120
"psr/http-message": "^1.1 || ^2.0"
2221
},
2322
"provide": {
@@ -27,6 +26,7 @@
2726
"ext-zlib": "*",
2827
"ergebnis/composer-normalize": "^2.6",
2928
"guzzlehttp/psr7": "^1.0 || ^2.0",
29+
"php-http/message-factory": "^1.0.2",
3030
"phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
3131
"slim/slim": "^3.0",
3232
"laminas/laminas-diactoros": "^2.0 || ^3.0"

Diff for: src/MessageFactory/DiactorosMessageFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
use Zend\Diactoros\Request as ZendRequest;
1010
use Zend\Diactoros\Response as ZendResponse;
1111

12+
if (!interface_exists(MessageFactory::class)) {
13+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\DiactorosMessageFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
14+
}
15+
1216
/**
1317
* Creates Diactoros messages.
1418
*

Diff for: src/MessageFactory/GuzzleMessageFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
use GuzzleHttp\Psr7\Response;
77
use Http\Message\MessageFactory;
88

9+
if (!interface_exists(MessageFactory::class)) {
10+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\GuzzleMessageFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
11+
}
12+
913
/**
1014
* Creates Guzzle messages.
1115
*

Diff for: src/MessageFactory/SlimMessageFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
use Slim\Http\Request;
1010
use Slim\Http\Response;
1111

12+
if (!interface_exists(MessageFactory::class)) {
13+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\SlimMessageFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
14+
}
15+
1216
/**
1317
* Creates Slim 3 messages.
1418
*

Diff for: src/StreamFactory/DiactorosStreamFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
use Psr\Http\Message\StreamInterface;
88
use Zend\Diactoros\Stream as ZendStream;
99

10+
if (!interface_exists(StreamFactory::class)) {
11+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\DiactorosStreamFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
12+
}
13+
1014
/**
1115
* Creates Diactoros streams.
1216
*

Diff for: src/StreamFactory/GuzzleStreamFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
use GuzzleHttp\Psr7\Utils;
66
use Http\Message\StreamFactory;
77

8+
if (!interface_exists(StreamFactory::class)) {
9+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\GuzzleStreamFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
10+
}
11+
812
/**
913
* Creates Guzzle streams.
1014
*

Diff for: src/StreamFactory/SlimStreamFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
use Psr\Http\Message\StreamInterface;
77
use Slim\Http\Stream;
88

9+
if (!interface_exists(StreamFactory::class)) {
10+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\SlimStreamFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
11+
}
12+
913
/**
1014
* Creates Slim 3 streams.
1115
*

Diff for: src/UriFactory/DiactorosUriFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
use Psr\Http\Message\UriInterface;
88
use Zend\Diactoros\Uri as ZendUri;
99

10+
if (!interface_exists(UriFactory::class)) {
11+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\DiactorosUriFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
12+
}
13+
1014
/**
1115
* Creates Diactoros URI.
1216
*

Diff for: src/UriFactory/GuzzleUriFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
use function GuzzleHttp\Psr7\uri_for;
99

10+
if (!interface_exists(UriFactory::class)) {
11+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\GuzzleUriFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
12+
}
13+
1014
/**
1115
* Creates Guzzle URI.
1216
*

Diff for: src/UriFactory/SlimUriFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
use Psr\Http\Message\UriInterface;
77
use Slim\Http\Uri;
88

9+
if (!interface_exists(UriFactory::class)) {
10+
throw new \LogicException('You cannot use "Http\Message\MessageFactory\SlimUriFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead');
11+
}
12+
913
/**
1014
* Creates Slim 3 URI.
1115
*

0 commit comments

Comments
 (0)