@@ -11,14 +11,14 @@ discard block |
||
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\\'; |
18 | 18 | $prefix = 'Miax\\'; |
19 | 19 | |
20 | 20 | // base directory for the namespace prefix |
21 | - $base_dir = __DIR__ . '/src/'; |
|
21 | + $base_dir = __DIR__.'/src/'; |
|
22 | 22 | |
23 | 23 | // does the class use the namespace prefix? |
24 | 24 | $len = strlen($prefix); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | // replace the namespace prefix with the base directory, replace namespace |
34 | 34 | // separators with directory separators in the relative class name, append |
35 | 35 | // with .php |
36 | - $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php'; |
|
36 | + $file = $base_dir.str_replace('\\', '/', $relative_class).'.php'; |
|
37 | 37 | |
38 | 38 | // if the file exists, require it |
39 | 39 | if (file_exists($file)) { |
@@ -12,29 +12,29 @@ |
||
12 | 12 | |
13 | 13 | class CRSSFeed { |
14 | 14 | |
15 | - // constructor - initialize SimplePie. |
|
16 | - public function __construct($feedArr, $duration = 3600) { |
|
17 | - $this->object = new SimplePie(); |
|
18 | - $this->object->set_cache_location(CACHE); |
|
19 | - $this->object->set_cache_duration($duration); |
|
20 | - $this->object->set_feed_url($feedArr); |
|
21 | - $this->object->init(); |
|
22 | - $this->object->handle_content_type(); |
|
23 | - } |
|
15 | + // constructor - initialize SimplePie. |
|
16 | + public function __construct($feedArr, $duration = 3600) { |
|
17 | + $this->object = new SimplePie(); |
|
18 | + $this->object->set_cache_location(CACHE); |
|
19 | + $this->object->set_cache_duration($duration); |
|
20 | + $this->object->set_feed_url($feedArr); |
|
21 | + $this->object->init(); |
|
22 | + $this->object->handle_content_type(); |
|
23 | + } |
|
24 | 24 | |
25 | - // return content. |
|
26 | - public function getFeed() { |
|
27 | - $html = '<article>'; |
|
28 | - $html .= "<h1>Senaste nytt från IDG</h1>"; |
|
29 | - foreach($this->object->get_items() as $content) { |
|
30 | - $html .= '<div class="feed-content">'; |
|
31 | - $html .= "<h2>" . $content->get_title() . "</h2>" ; |
|
32 | - $html .= "<small>Postad ". $content->get_date('Y-m-d | H:i:s')."</small>"; |
|
33 | - $html .= "<p>{$content->get_content()}</p>"; |
|
34 | - $html .= "<p><a href='" . $content->get_permalink() . "'>Läs mer</a>"; |
|
35 | - $html .= '</div>'; |
|
36 | - } |
|
37 | - $html .= "</article>"; |
|
38 | - return $html; |
|
39 | - } |
|
25 | + // return content. |
|
26 | + public function getFeed() { |
|
27 | + $html = '<article>'; |
|
28 | + $html .= "<h1>Senaste nytt från IDG</h1>"; |
|
29 | + foreach($this->object->get_items() as $content) { |
|
30 | + $html .= '<div class="feed-content">'; |
|
31 | + $html .= "<h2>" . $content->get_title() . "</h2>" ; |
|
32 | + $html .= "<small>Postad ". $content->get_date('Y-m-d | H:i:s')."</small>"; |
|
33 | + $html .= "<p>{$content->get_content()}</p>"; |
|
34 | + $html .= "<p><a href='" . $content->get_permalink() . "'>Läs mer</a>"; |
|
35 | + $html .= '</div>'; |
|
36 | + } |
|
37 | + $html .= "</article>"; |
|
38 | + return $html; |
|
39 | + } |
|
40 | 40 | } |
41 | 41 | \ No newline at end of file |
@@ -26,12 +26,12 @@ |
||
26 | 26 | public function getFeed() { |
27 | 27 | $html = '<article>'; |
28 | 28 | $html .= "<h1>Senaste nytt från IDG</h1>"; |
29 | - foreach($this->object->get_items() as $content) { |
|
29 | + foreach ($this->object->get_items() as $content) { |
|
30 | 30 | $html .= '<div class="feed-content">'; |
31 | - $html .= "<h2>" . $content->get_title() . "</h2>" ; |
|
32 | - $html .= "<small>Postad ". $content->get_date('Y-m-d | H:i:s')."</small>"; |
|
31 | + $html .= "<h2>".$content->get_title()."</h2>"; |
|
32 | + $html .= "<small>Postad ".$content->get_date('Y-m-d | H:i:s')."</small>"; |
|
33 | 33 | $html .= "<p>{$content->get_content()}</p>"; |
34 | - $html .= "<p><a href='" . $content->get_permalink() . "'>Läs mer</a>"; |
|
34 | + $html .= "<p><a href='".$content->get_permalink()."'>Läs mer</a>"; |
|
35 | 35 | $html .= '</div>'; |
36 | 36 | } |
37 | 37 | $html .= "</article>"; |