| Conditions | 2 |
| Paths | 2 |
| Total Lines | 23 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 18 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 1 | public function readRSS(){ |
|
| 30 | |||
| 31 | 1 | $html = "<article>"; |
|
| 32 | 1 | $heading = $this->heading; |
|
| 33 | 1 | $html .= "<h1>$heading</h1>"; |
|
| 34 | 1 | $xml = simplexml_load_file($this->url); |
|
| 35 | 1 | for($i = 0; $i < $this->items; $i++){ |
|
| 36 | 1 | $title = $xml->channel->item[$i]->title; |
|
| 37 | 1 | $link = $xml->channel->item[$i]->link; |
|
| 38 | 1 | $description = $xml->channel->item[$i]->description; |
|
| 39 | 1 | $pubDate = $xml->channel->item[$i]->pubDate; |
|
| 40 | |||
| 41 | // Formatting the date |
||
| 42 | 1 | $pubDate= date("D, d M Y H:i:s T", strtotime($pubDate)); |
|
| 43 | |||
| 44 | 1 | $html .= "<a href='$link'><h3>$title</h3></a>"; |
|
| 45 | 1 | $html .= "<small>$pubDate</small><br /><br />"; |
|
| 46 | 1 | $html .= "$description"; |
|
| 47 | 1 | $html .= "<hr />"; |
|
| 48 | 1 | } |
|
| 49 | 1 | $html .= "</article>"; |
|
| 50 | |||
| 51 | 1 | return $html; |
|
| 52 | |||
| 56 |
This check marks private properties in classes that are never used. Those properties can be removed.