NewsTicker   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
c 2
b 0
f 0
lcom 1
cbo 0
dl 0
loc 42
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getNewsTickerParser() 0 3 1
A setNewsTickerParser() 0 3 1
A __construct() 0 5 1
A getOutput() 0 9 2
1
<?php
2
/**
3
 * User: ms
4
 * Date: 14.09.15
5
 * Time: 22:05
6
 */
7
8
namespace Mvg\TextOutput;
9
10
use  Mvg\Parser\Html\NewsTicker as NewsTickerParser;
0 ignored issues
show
Coding Style introduced by
There must be a single space after the USE keyword
Loading history...
11
12
class NewsTicker {
13
14
	/**
15
	 * @va  Mvg\Parser\Html\NewsTicker
16
	 */
17
	protected $newsTickerParser = null;
18
19
20
	/**
21
	 * @param  Mvg\Parser\Html\NewsTicker $newsTickerParser
0 ignored issues
show
Documentation introduced by
Should the type for parameter $newsTickerParser not be NewsTickerParser?

This check looks for @param annotations where the type inferred by our type inference engine differs from the declared type.

It makes a suggestion as to what type it considers more descriptive.

Most often this is a case of a parameter that can be null in addition to its declared types.

Loading history...
22
	 */
23
	public function __construct(NewsTickerParser $newsTickerParser) {
24
25
		$this->setNewsTickerParser($newsTickerParser);
26
27
	}
28
29
	public function getOutput() {
30
		$str = '';
31
		foreach ($this->getNewsTickerParser()->getInterferences() as $interference) {
32
33
			$str .= '===' . $interference->lines . '===' . "\n";
34
			$str .= $interference->messages . "\n";
35
		}
36
		return $str;
37
	}
38
39
	/**
40
	 * @return  Mvg\Parser\Html\NewsTicker
41
	 */
42
	protected function getNewsTickerParser() {
43
		return $this->newsTickerParser;
44
	}
45
46
	/**
47
	 * @param   Mvg\Parser\Html\NewsTicker
48
	 */
49
	protected function setNewsTickerParser($newsTickerParser) {
50
		$this->newsTickerParser = $newsTickerParser;
51
	}
52
53
}