Permalink
Browse files

Fixed coding standard issues in pull request 224

  • Loading branch information...
1 parent 84c8336 commit 315e30d174e51ed9225cc7ce65ef9c7b864b2973 @elazar elazar committed Jul 1, 2012
Showing with 26 additions and 22 deletions.
  1. +26 −22 Phergie/Plugin/FeedParser.php
@@ -84,11 +84,12 @@ public function parseFeed($content, $header='')
}
if (!empty($header)) {
- $this->feed->etag = NULL;
- if (isset($header['etag']))
- $this->feed->etag = $header['etag'];
+ $this->feed->etag = NULL;
+ if (isset($header['etag'])) {
+ $this->feed->etag = $header['etag'];
+ }
if (empty($this->feed->updated)) {
- // Very dificult to happen,
+ // Very difficult to happen,
// but there are some servers that we can't get any
// kind of "last modified time"
if (empty($header['last-modified'])) {
@@ -119,7 +120,7 @@ public function parseItemsRSS($items)
if (!empty($item->title)) {
$title = (String)$item->title;
- } else if (empty($item->title) AND !empty($item->description)) {
+ } elseif (empty($item->title) AND !empty($item->description)) {
$title = substr(strip_tags($item->description), 0, 100)."...";
} else {
// Without a title or description, we dont have an item
@@ -129,23 +130,26 @@ public function parseItemsRSS($items)
// Try to get the author and updated time from dc namespace
// (Used on Wordpress and others)
$namespaces = $item->getNameSpaces(true);
- $dc = NULL;
- if (isset($namespaces['dc']))
- $dc = $item->children($namespaces['dc']);
-
- $author = 'Unknown';
- if (isset($item->author))
- $author = $item->author;
- else if (isset($dc->creator))
- $author = $dc->creator;
-
- $pubDate = '01.01.1970';
- if (isset($item->pubDate))
- $pubDate = $item->pubDate;
- if (isset($dc->date))
- $pubDate = $dc->date;
-
- $link = (String) $item->link;
+ $dc = NULL;
+ if (isset($namespaces['dc'])) {
+ $dc = $item->children($namespaces['dc']);
+ }
+
+ $author = 'Unknown';
+ if (isset($item->author)) {
+ $author = $item->author;
+ } elseif (isset($dc->creator)) {
+ $author = $dc->creator;
+ }
+
+ $pubDate = '01.01.1970';
+ if (isset($item->pubDate)) {
+ $pubDate = $item->pubDate;
+ } elseif (isset($dc->date)) {
+ $pubDate = $dc->date;
+ }
+
+ $link = (string) $item->link;
$ret[] = array(
'title' => $title,

0 comments on commit 315e30d

Please sign in to comment.