From a778d3fea727e80cfa47aa57c98438d9f527a85a Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Thu, 14 Dec 2023 22:07:33 +0100 Subject: Inline once-called short private methods to its caller, part 1 This makes the code easier to read to avoid jumps and improves encapsulation by not allowing the rest of the class having access to the logic. Of course, if needed then some code can be refactored out again but for now let's not do YAGNI. Change-Id: Ic37524e386fc04fd67e33768417ff8425f85b0ca --- includes/Feed/AtomFeed.php | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'includes/Feed') diff --git a/includes/Feed/AtomFeed.php b/includes/Feed/AtomFeed.php index 0ed7f76e6cdb..79c7e208f5b4 100644 --- a/includes/Feed/AtomFeed.php +++ b/includes/Feed/AtomFeed.php @@ -56,7 +56,11 @@ class AtomFeed extends ChannelFeed { // uses htmlentities, which does not work with XML $templateParams = [ 'language' => $this->xmlEncode( $this->getLanguage() ), - 'feedID' => $this->getFeedId(), + // Atom 1.0 requires a unique, opaque IRI as a unique identifier + // for every feed we create. For now just use the URL, but who + // can tell if that's right? If we put options on the feed, do we + // have to change the id? Maybe? Maybe not. + 'feedID' => $this->getSelfUrl(), 'title' => $this->getTitle(), 'url' => $this->xmlEncode( wfExpandUrl( $this->getUrlUnescaped(), PROTO_CURRENT ) ), 'selfUrl' => $this->getSelfUrl(), @@ -67,18 +71,6 @@ class AtomFeed extends ChannelFeed { print $this->templateParser->processTemplate( 'AtomHeader', $templateParams ); } - /** - * Atom 1.0 requires a unique, opaque IRI as a unique identifier - * for every feed we create. For now just use the URL, but who - * can tell if that's right? If we put options on the feed, do we - * have to change the id? Maybe? Maybe not. - * - * @return string - */ - private function getFeedId() { - return $this->getSelfUrl(); - } - /** * Atom 1.0 requests a self-reference to the feed. * @return string -- cgit v1.2.3