Skip to content

Commit

Permalink
Support for Buzz 1.0 (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nyholm authored and dbu committed Dec 29, 2018
1 parent a6beda1 commit e78e0b2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Strategy/CommonClassesStrategy.php
Expand Up @@ -5,6 +5,7 @@
use GuzzleHttp\Psr7\Request as GuzzleRequest;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Http\Discovery\MessageFactoryDiscovery;
use Http\Message\MessageFactory;
use Http\Message\MessageFactory\GuzzleMessageFactory;
use Http\Message\StreamFactory;
Expand Down Expand Up @@ -76,6 +77,10 @@ final class CommonClassesStrategy implements DiscoveryStrategy
['class' => Cake::class, 'condition' => Cake::class],
['class' => Zend::class, 'condition' => Zend::class],
['class' => Artax::class, 'condition' => Artax::class],
[
'class' => [self::class, 'buzzInstantiate'],
'condition' => [\Buzz\Client\FileGetContents::class, \Buzz\Message\ResponseBuilder::class],
],
],
];

Expand All @@ -90,4 +95,9 @@ public static function getCandidates($type)

return [];
}

public static function buzzInstantiate()
{
return new \Buzz\Client\FileGetContents(MessageFactoryDiscovery::find());
}
}

0 comments on commit e78e0b2

Please sign in to comment.