NewsTicker::getNewsTickerParser()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
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
}