X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Ffeed%2FFeedBuilder.php;fp=application%2FFeedBuilder.php;h=b66f2f918edd494f1d11090892fbcfda7d073e59;hb=ff3b5dc5542ec150f0d9b447394364a15e9156d0;hp=73fafcbed31cb733ac0bf99611313d861a1b60a0;hpb=1826e383ecf501302974132fd443cf1ca06e10f6;p=github%2Fshaarli%2FShaarli.git diff --git a/application/FeedBuilder.php b/application/feed/FeedBuilder.php similarity index 84% rename from application/FeedBuilder.php rename to application/feed/FeedBuilder.php index 73fafcbe..b66f2f91 100644 --- a/application/FeedBuilder.php +++ b/application/feed/FeedBuilder.php @@ -1,4 +1,7 @@ hideDates || $this->isLoggedIn; // Remove leading slash from REQUEST_URI. $data['self_link'] = escape(server_url($this->serverInfo)) - . escape($this->serverInfo['REQUEST_URI']); + . escape($this->serverInfo['REQUEST_URI']); $data['index_url'] = $pageaddr; $data['usepermalinks'] = $this->usePermalinks === true; $data['links'] = $linkDisplayed; @@ -142,18 +146,18 @@ class FeedBuilder */ protected function buildItem($link, $pageaddr) { - $link['guid'] = $pageaddr .'?'. $link['shorturl']; + $link['guid'] = $pageaddr . '?' . $link['shorturl']; // Check for both signs of a note: starting with ? and 7 chars long. if ($link['url'][0] === '?' && strlen($link['url']) === 7) { $link['url'] = $pageaddr . $link['url']; } if ($this->usePermalinks === true) { - $permalink = ''. t('Direct link') .''; + $permalink = '' . t('Direct link') . ''; } else { - $permalink = ''. t('Permalink') .''; + $permalink = '' . t('Permalink') . ''; } - $link['description'] = format_description($link['description'], '', false, $pageaddr); - $link['description'] .= PHP_EOL .'
— '. $permalink; + $link['description'] = format_description($link['description'], '', false, $pageaddr); + $link['description'] .= PHP_EOL . '
— ' . $permalink; $pubDate = $link['created']; $link['pub_iso_date'] = $this->getIsoDate($pubDate); @@ -164,7 +168,6 @@ class FeedBuilder $link['up_iso_date'] = $this->getIsoDate($upDate, DateTime::ATOM); } else { $link['up_iso_date'] = $this->getIsoDate($pubDate, DateTime::ATOM); - ; } // Save the more recent item. @@ -223,11 +226,11 @@ class FeedBuilder public function getTypeLanguage() { // Use the locale do define the language, if available. - if (! empty($this->locale) && preg_match('/^\w{2}[_\-]\w{2}/', $this->locale)) { - $length = ($this->feedType == self::$FEED_RSS) ? 5 : 2; + if (!empty($this->locale) && preg_match('/^\w{2}[_\-]\w{2}/', $this->locale)) { + $length = ($this->feedType === self::$FEED_RSS) ? 5 : 2; return str_replace('_', '-', substr($this->locale, 0, $length)); } - return ($this->feedType == self::$FEED_RSS) ? 'en-en' : 'en'; + return ($this->feedType === self::$FEED_RSS) ? 'en-en' : 'en'; } /** @@ -287,7 +290,7 @@ class FeedBuilder } $intNb = intval($this->userInput['nb']); - if (! is_int($intNb) || $intNb == 0) { + if (!is_int($intNb) || $intNb == 0) { return self::$DEFAULT_NB_LINKS; }