Skip to content

Discovery support for Slim Framework factories #80

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
Oct 15, 2016
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Change Log


## Unreleased

### Added

- Discovery support for Slim Framework factories

## 1.0.0 - 2016-07-18

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/MessageFactoryDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function find()
$messageFactory = static::findOneByType(MessageFactory::class);
} catch (DiscoveryFailedException $e) {
throw new NotFoundException(
'No message factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.',
'No message factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.',
0,
$e
);
Expand Down
7 changes: 7 additions & 0 deletions src/Strategy/CommonClassesStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
use Http\Message\StreamFactory\DiactorosStreamFactory;
use Http\Message\UriFactory\DiactorosUriFactory;
use Zend\Diactoros\Request as DiactorosRequest;
use Http\Message\MessageFactory\SlimMessageFactory;
use Http\Message\StreamFactory\SlimStreamFactory;
use Http\Message\UriFactory\SlimUriFactory;
use Slim\Http\Request as SlimRequest;
use Http\Adapter\Guzzle6\Client as Guzzle6;
use Http\Adapter\Guzzle5\Client as Guzzle5;
use Http\Client\Curl\Client as Curl;
Expand All @@ -31,14 +35,17 @@ final class CommonClassesStrategy implements DiscoveryStrategy
'Http\Message\MessageFactory' => [
['class' => GuzzleMessageFactory::class, 'condition' => [GuzzleRequest::class, GuzzleMessageFactory::class]],
['class' => DiactorosMessageFactory::class, 'condition' => [DiactorosRequest::class, DiactorosMessageFactory::class]],
['class' => SlimMessageFactory::class, 'condition' => [SlimRequest::class, SlimMessageFactory::class]],
],
'Http\Message\StreamFactory' => [
['class' => GuzzleStreamFactory::class, 'condition' => [GuzzleRequest::class, GuzzleStreamFactory::class]],
['class' => DiactorosStreamFactory::class, 'condition' => [DiactorosRequest::class, DiactorosStreamFactory::class]],
['class' => SlimStreamFactory::class, 'condition' => [SlimRequest::class, SlimStreamFactory::class]],
],
'Http\Message\UriFactory' => [
['class' => GuzzleUriFactory::class, 'condition' => [GuzzleRequest::class, GuzzleUriFactory::class]],
['class' => DiactorosUriFactory::class, 'condition' => [DiactorosRequest::class, DiactorosUriFactory::class]],
['class' => SlimUriFactory::class, 'condition' => [SlimRequest::class, SlimUriFactory::class]],
],
'Http\Client\HttpAsyncClient' => [
['class' => Guzzle6::class, 'condition' => Guzzle6::class],
Expand Down
2 changes: 1 addition & 1 deletion src/StreamFactoryDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function find()
$streamFactory = static::findOneByType(StreamFactory::class);
} catch (DiscoveryFailedException $e) {
throw new NotFoundException(
'No stream factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.',
'No stream factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.',
0,
$e
);
Expand Down
2 changes: 1 addition & 1 deletion src/UriFactoryDiscovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public static function find()
$uriFactory = static::findOneByType(UriFactory::class);
} catch (DiscoveryFailedException $e) {
throw new NotFoundException(
'No uri factories found. To use Guzzle or Diactoros factories install php-http/message and the chosen message implementation.',
'No uri factories found. To use Guzzle, Diactoros or Slim Framework factories install php-http/message and the chosen message implementation.',
0,
$e
);
Expand Down