@@ -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)) { |
@@ -1,4 +1,4 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -include __DIR__ . "/../autoloader.php"; |
|
| 3 | +include __DIR__."/../autoloader.php"; |
|
| 4 | 4 | //include __DIR__ . "/../src/CRSSFeed.php"; |
| 5 | 5 | \ No newline at end of file |
@@ -26,12 +26,12 @@ |
||
| 26 | 26 | $feedItems = $this->object->get_items(); |
| 27 | 27 | $html = '<article>'; |
| 28 | 28 | $html .= "<h1>Senaste nytt fran IDG</h1>"; |
| 29 | - foreach($feedItems as $content) { |
|
| 29 | + foreach ($feedItems 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>"; |
@@ -23,14 +23,14 @@ discard block |
||
| 23 | 23 | private $feed; |
| 24 | 24 | |
| 25 | 25 | |
| 26 | - public function setUp(){ |
|
| 26 | + public function setUp() { |
|
| 27 | 27 | $rss = new SimplePie(); |
| 28 | - $rss->get_items(1,1); |
|
| 28 | + $rss->get_items(1, 1); |
|
| 29 | 29 | $this->feed = new CRSSFeed($rss); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| 33 | - public function testAssertTags(){ |
|
| 33 | + public function testAssertTags() { |
|
| 34 | 34 | $matcher = array( |
| 35 | 35 | 'tag' => 'h1', 'content' => 'regexp:/<h1>.*<\/h1>/', |
| 36 | 36 | 'parent' => array('tag' => 'article') |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| 48 | - public function testGetFeed(){ |
|
| 48 | + public function testGetFeed() { |
|
| 49 | 49 | $this->assertInternalType('string', 'regexp:/<article>.*<\/article>/'); |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | \ No newline at end of file |