Skip to content

Remove direct dependency on php-http/message-factory #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.16.0] - 2023-XX-XX

- Remove direct dependency on php-http/message-factory

## [1.15.0] - 2023-05-10

**If you use the decorator classes, you might need to adjust your code to the parameter and return type declarations added in PSR-7**
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"require": {
"php": "^7.2 || ^8.0",
"clue/stream-filter": "^1.5",
"php-http/message-factory": "^1.0.2",
"psr/http-message": "^1.1 || ^2.0"
},
"provide": {
Expand All @@ -27,6 +26,7 @@
"ext-zlib": "*",
"ergebnis/composer-normalize": "^2.6",
"guzzlehttp/psr7": "^1.0 || ^2.0",
"php-http/message-factory": "^1.0.2",
"phpspec/phpspec": "^5.1 || ^6.3 || ^7.1",
"slim/slim": "^3.0",
"laminas/laminas-diactoros": "^2.0 || ^3.0"
Expand Down
4 changes: 4 additions & 0 deletions src/MessageFactory/DiactorosMessageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
use Zend\Diactoros\Request as ZendRequest;
use Zend\Diactoros\Response as ZendResponse;

if (!interface_exists(MessageFactory::class)) {
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');
}

/**
* Creates Diactoros messages.
*
Expand Down
4 changes: 4 additions & 0 deletions src/MessageFactory/GuzzleMessageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use GuzzleHttp\Psr7\Response;
use Http\Message\MessageFactory;

if (!interface_exists(MessageFactory::class)) {
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');
}

/**
* Creates Guzzle messages.
*
Expand Down
4 changes: 4 additions & 0 deletions src/MessageFactory/SlimMessageFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
use Slim\Http\Request;
use Slim\Http\Response;

if (!interface_exists(MessageFactory::class)) {
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');
}

/**
* Creates Slim 3 messages.
*
Expand Down
4 changes: 4 additions & 0 deletions src/StreamFactory/DiactorosStreamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use Psr\Http\Message\StreamInterface;
use Zend\Diactoros\Stream as ZendStream;

if (!interface_exists(StreamFactory::class)) {
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');
}

/**
* Creates Diactoros streams.
*
Expand Down
4 changes: 4 additions & 0 deletions src/StreamFactory/GuzzleStreamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
use GuzzleHttp\Psr7\Utils;
use Http\Message\StreamFactory;

if (!interface_exists(StreamFactory::class)) {
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');
}

/**
* Creates Guzzle streams.
*
Expand Down
4 changes: 4 additions & 0 deletions src/StreamFactory/SlimStreamFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use Psr\Http\Message\StreamInterface;
use Slim\Http\Stream;

if (!interface_exists(StreamFactory::class)) {
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');
}

/**
* Creates Slim 3 streams.
*
Expand Down
4 changes: 4 additions & 0 deletions src/UriFactory/DiactorosUriFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
use Psr\Http\Message\UriInterface;
use Zend\Diactoros\Uri as ZendUri;

if (!interface_exists(UriFactory::class)) {
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');
}

/**
* Creates Diactoros URI.
*
Expand Down
4 changes: 4 additions & 0 deletions src/UriFactory/GuzzleUriFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

use function GuzzleHttp\Psr7\uri_for;

if (!interface_exists(UriFactory::class)) {
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');
}

/**
* Creates Guzzle URI.
*
Expand Down
4 changes: 4 additions & 0 deletions src/UriFactory/SlimUriFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
use Psr\Http\Message\UriInterface;
use Slim\Http\Uri;

if (!interface_exists(UriFactory::class)) {
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');
}

/**
* Creates Slim 3 URI.
*
Expand Down