Skip to content

Commit 664d232

Browse files
committed
Use fluid interface for build RSS feed
1 parent fcb2481 commit 664d232

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Classes/Controller/PostController.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class PostController extends ActionController
5959
* @return string
6060
* @throws NodeException
6161
* @throws MissingActionNameException
62-
* @throws \Neos\Flow\Http\Exception
6362
*/
6463
public function rssAction(): string
6564
{
@@ -88,22 +87,22 @@ public function rssAction(): string
8887
}
8988

9089
$channel = new Channel();
91-
$channel->setTitle($feedTitle);
92-
$channel->setDescription($feedDescription);
93-
$channel->setFeedUri($feedUri);
94-
$channel->setWebsiteUri((string)RequestInformationHelper::generateBaseUri($this->request->getHttpRequest()));
95-
$channel->setLanguage((string)$this->i18nService->getConfiguration()->getCurrentLocale());
90+
$channel->setTitle($feedTitle)
91+
->setDescription($feedDescription)
92+
->setFeedUri($feedUri)
93+
->setWebsiteUri((string)RequestInformationHelper::generateBaseUri($this->request->getHttpRequest()))
94+
->setLanguage((string)$this->i18nService->getConfiguration()->getCurrentLocale());
9695

9796
/* @var $postNode NodeInterface */
9897
foreach ($postsNode->getChildNodes('RobertLemke.Plugin.Blog:Post') as $postNode) {
9998
$postUri = $uriBuilder->uriFor('show', ['node' => $postNode], 'Frontend\Node', 'Neos.Neos');
10099

101100
$item = new Item();
102-
$item->setTitle($postNode->getProperty('title'));
103-
$item->setGuid($postNode->getIdentifier());
104-
$item->setPublicationDate($postNode->getProperty('datePublished'));
105-
$item->setItemLink((string)$postUri);
106-
$item->setCommentsLink((string)$postUri . '#comments');
101+
$item->setTitle($postNode->getProperty('title'))
102+
->setGuid($postNode->getIdentifier())
103+
->setPublicationDate($postNode->getProperty('datePublished'))
104+
->setItemLink((string)$postUri)
105+
->setCommentsLink((string)$postUri . '#comments');
107106

108107
$author = $postNode->getProperty('author');
109108
if ($author instanceof NodeInterface) {

0 commit comments

Comments
 (0)