@@ -11,7 +11,7 @@ |
||
11 | 11 | * @param string $class The fully-qualified class name. |
12 | 12 | * @return void |
13 | 13 | */ |
14 | -spl_autoload_register(function ($class) { |
|
14 | +spl_autoload_register(function($class) { |
|
15 | 15 | |
16 | 16 | // project-specific namespace prefix |
17 | 17 | //$prefix = 'Foo\\Bar\\'; |
@@ -5,7 +5,7 @@ |
||
5 | 5 | */ |
6 | 6 | |
7 | 7 | // Get environment & autoloader and the $app-object. |
8 | -require __DIR__.'/config_with_app.php'; |
|
8 | +require __DIR__ . '/config_with_app.php'; |
|
9 | 9 | |
10 | 10 | // Prepare the page content |
11 | 11 | $rss = new Anax\Rssfeed\CRssfeed([ |
@@ -20,26 +20,26 @@ |
||
20 | 20 | * |
21 | 21 | * @param array $options to alter the default behaviour. |
22 | 22 | */ |
23 | - public function __construct($options=array()) { |
|
23 | + public function __construct($options = array()) { |
|
24 | 24 | $this->url = $options['url']; |
25 | 25 | $this->heading = $options['heading']; |
26 | 26 | $this->items = $options['items']; |
27 | 27 | } |
28 | 28 | |
29 | - public function readRSS(){ |
|
29 | + public function readRSS() { |
|
30 | 30 | |
31 | 31 | $html = "<article>"; |
32 | 32 | $heading = $this->heading; |
33 | 33 | $html .= "<h1>$heading</h1>"; |
34 | 34 | $xml = simplexml_load_file($this->url); |
35 | - for($i = 0; $i < $this->items; $i++){ |
|
35 | + for ($i = 0; $i < $this->items; $i++) { |
|
36 | 36 | $title = $xml->channel->item[$i]->title; |
37 | 37 | $link = $xml->channel->item[$i]->link; |
38 | 38 | $description = $xml->channel->item[$i]->description; |
39 | 39 | $pubDate = $xml->channel->item[$i]->pubDate; |
40 | 40 | |
41 | 41 | // Formatting the date |
42 | - $pubDate= date("D, d M Y H:i:s T", strtotime($pubDate)); |
|
42 | + $pubDate = date("D, d M Y H:i:s T", strtotime($pubDate)); |
|
43 | 43 | |
44 | 44 | $html .= "<a href='$link'><h3>$title</h3></a>"; |
45 | 45 | $html .= "<small>$pubDate</small><br /><br />"; |