diff options
author | Amir Sarabadani <ladsgroup@gmail.com> | 2023-12-14 22:07:33 +0100 |
---|---|---|
committer | C. Scott Ananian <cananian@wikimedia.org> | 2023-12-18 23:43:32 +0000 |
commit | a778d3fea727e80cfa47aa57c98438d9f527a85a (patch) | |
tree | 907b1e783726ab73c2bdd8b87beee724af3d847e /includes/Feed | |
parent | 6483408511a0dee8ed0431f872023ace507f3c56 (diff) | |
download | mediawikicore-a778d3fea727e80cfa47aa57c98438d9f527a85a.tar.gz mediawikicore-a778d3fea727e80cfa47aa57c98438d9f527a85a.zip |
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
Diffstat (limited to 'includes/Feed')
-rw-r--r-- | includes/Feed/AtomFeed.php | 18 |
1 files changed, 5 insertions, 13 deletions
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(), @@ -68,18 +72,6 @@ class AtomFeed extends ChannelFeed { } /** - * 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 */ |