diff options
author | Maurice Svay <maurice@svay.com> | 2012-03-08 23:19:52 -0800 |
---|---|---|
committer | Maurice Svay <maurice@svay.com> | 2012-03-08 23:19:52 -0800 |
commit | 69bf1b314b84c979c220e26b931e722712b5d531 (patch) | |
tree | ea5c6f8a3faf8b33a0b556dff916c52bcf7fed64 /app/classes/PlanetItem.php | |
parent | 7b17df6521505b9f0d72ba3df233e3ed1fe585e2 (diff) | |
parent | 4c3eb70d049e4376eec5fea393ad6529b98a5f10 (diff) | |
download | planet-69bf1b314b84c979c220e26b931e722712b5d531.tar planet-69bf1b314b84c979c220e26b931e722712b5d531.tar.gz planet-69bf1b314b84c979c220e26b931e722712b5d531.tar.bz2 planet-69bf1b314b84c979c220e26b931e722712b5d531.tar.xz planet-69bf1b314b84c979c220e26b931e722712b5d531.zip |
Merge pull request #21 from pascalchevrel/ConvertPHP4code
Refactoring, this is a syntax change for all Planet* classes to use PHP5 syntax
Diffstat (limited to 'app/classes/PlanetItem.php')
-rw-r--r-- | app/classes/PlanetItem.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/app/classes/PlanetItem.php b/app/classes/PlanetItem.php index b3f1fb9..039d0ca 100644 --- a/app/classes/PlanetItem.php +++ b/app/classes/PlanetItem.php @@ -3,20 +3,25 @@ /** * Planet item */ -class PlanetItem{ - function __construct($feed, $data){ + +class PlanetItem +{ + public function __construct($feed, $data) + { parent::SimplePie_Item($feed, $data); } - function compare($item1, $item2){ + public function compare($item1, $item2) + { $item1_date = $item1->get_date('U'); $item2_date = $item2->get_date('U'); - if ($item1_date == $item2_date){ + + if ($item1_date == $item2_date) { return 0; - } - else if ($item1_date < $item2_date){ + } elseif ($item1_date < $item2_date) { return 1; } + return -1; } -}
\ No newline at end of file +} |