-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb32f89
commit 105018f
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Inboxly\Receiver; | ||
|
||
use FeedIo\Adapter\Guzzle\Client as ClientAdapter; | ||
use FeedIo\FeedIo; | ||
use GuzzleHttp\Client; | ||
use GuzzleHttp\ClientInterface; | ||
use Illuminate\Support\ServiceProvider; | ||
use Psr\Log\NullLogger; | ||
|
||
class FeedIoServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Register services. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app->bind(ClientInterface::class, Client::class); | ||
} | ||
|
||
/** | ||
* Bootstrap services. | ||
* | ||
* @return void | ||
* @throws \Illuminate\Contracts\Container\BindingResolutionException | ||
*/ | ||
public function boot() | ||
{ | ||
$guzzle = $this->app->make(ClientInterface::class); | ||
$feedIo = new FeedIo(new ClientAdapter($guzzle), new NullLogger()); | ||
|
||
$this->app->instance(FeedIo::class, $feedIo); | ||
} | ||
} |