| @@ -13,9 +13,9 @@ | ||
| 13 | 13 | * To parse a string representation of a date-time from a feed, instantiate and |
| 14 | 14 | * then pull the timestamp: |
| 15 | 15 | * |
| 16 | 16 | * $time = new FeedTime($s); |
| 17 | - * if ( ! $time->failed()) : | |
| 17 | + * if (!$time->failed()) : | |
| 18 | 18 | * $ts = $time->timestamp(); |
| 19 | 19 | * else : |
| 20 | 20 | * // ... |
| 21 | 21 | * endif; |
| @@ -23,16 +23,12 @@ | ||
| 23 | 23 | class FeedTime { |
| 24 | 24 | var $rep; |
| 25 | 25 | var $ts; |
| 26 | 26 | |
| 27 | - function __construct( $time ) { | |
| 27 | + function FeedTime ($time) { | |
| 28 | 28 | $this->set($time); |
| 29 | 29 | } /* FeedTime constructor */ |
| 30 | 30 | |
| 31 | - function FeedTime( $time ) { | |
| 32 | - self::__construct( $time ); | |
| 33 | - } | |
| 34 | - | |
| 35 | 31 | function set ($time, $recurse = false) { |
| 36 | 32 | $this->rep = $time; |
| 37 | 33 | $this->ts = NULL; |
| 38 | 34 | if (is_numeric($time)) : // Presumably a Unix-epoch timestamp |
| @@ -63,9 +59,9 @@ | ||
| 63 | 59 | } /* FeedTime::set() */ |
| 64 | 60 | |
| 65 | 61 | function timestamp () { |
| 66 | 62 | $unix = NULL; |
| 67 | - if ( ! $this->failed()) : | |
| 63 | + if (!$this->failed()) : | |
| 68 | 64 | $unix = $this->ts; |
| 69 | 65 | endif; |
| 70 | 66 | return $unix; |
| 71 | 67 | } /* FeedTime::timestamp() */ |
| @@ -70,9 +66,9 @@ | ||
| 70 | 66 | return $unix; |
| 71 | 67 | } /* FeedTime::timestamp() */ |
| 72 | 68 | |
| 73 | 69 | function failed () { |
| 74 | - return ( !is_numeric($this->ts) or ! $this->ts or ($this->ts <= 0)); | |
| 70 | + return (!is_numeric($this->ts) or !$this->ts or ($this->ts <= 0)); | |
| 75 | 71 | } /* FeedTime::failed() */ |
| 76 | 72 | |
| 77 | 73 | /** |
| 78 | 74 | * FeedTime::parse_w3cdtf() parses a W3C date-time format date into a |