Skip to content

Commit

Permalink
Merge pull request #188 from alexdebril/issue/injection
Browse files Browse the repository at this point in the history
Inject the FeedBuilder in the action's parameters
  • Loading branch information
alexdebril authored Aug 9, 2019
2 parents f34efe4 + 5f9c469 commit 2e12f82
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions Controller/StreamController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,16 @@
class StreamController
{

/**
* @var FeedBuilder
*/
private $feedBuilder;

/**
* @param FeedBuilder $feedBuilder
*/
public function __construct(FeedBuilder $feedBuilder)
{
$this->feedBuilder = $feedBuilder;
}

/**
* @param Request $request
* @param FeedBuilder $feedBuilder
* @param FeedProviderInterface $provider
* @return Response
*/
public function indexAction(Request $request, FeedProviderInterface $provider) : Response
public function indexAction(Request $request, FeedBuilder $feedBuilder, FeedProviderInterface $provider) : Response
{
try {
return $this->feedBuilder->getResponse(
return $feedBuilder->getResponse(
$request->get('format', 'rss'),
$provider->getFeed($request)
);
Expand Down

0 comments on commit 2e12f82

Please sign in to comment.