Skip to content

Commit ce5af80

Browse files
committed
Simplify FeedsController a little
1 parent 19c28ce commit ce5af80

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

app/Controllers/FeedsController.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ public function __construct(Builder $builder)
3333
*/
3434
public function getAtom()
3535
{
36-
$this->builder->setType('atom');
37-
38-
return $this->builder->render();
36+
return $this->builder->render('atom');
3937
}
4038

4139
/**
@@ -45,8 +43,6 @@ public function getAtom()
4543
*/
4644
public function getRss()
4745
{
48-
$this->builder->setType('rss');
49-
50-
return $this->builder->render();
46+
return $this->builder->render('rss');
5147
}
5248
}

app/Tricks/Services/Feeds/Builder.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ public function setCharset($charset)
8888
*
8989
* @return \Illuminate\Http\Response
9090
*/
91-
public function render()
91+
public function render($type)
9292
{
93+
$this->setType($type);
94+
9395
$data = $this->getFeedData();
9496
$view = $this->prepareView($data);
9597

0 commit comments

Comments
 (0)