Completed
Push — master ( 1408f8...7f35a0 )
by Peter
04:28
created

Utility::getPaths()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
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 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * This software package is licensed under `AGPL, Commercial` license[s].
5
 *
6
 * @package maslosoft/signals
7
 * @license AGPL, Commercial
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 *
11
 */
12
13
namespace Maslosoft\Signals;
14
15
/**
16
 * Signals utility class
17
 * @codeCoverageIgnore
18
 * @author Piotr
19
 */
20
class Utility
21
{
22
23
	/**
24
	 * Signal instance
25
	 * @var Signal
26
	 */
27
	private $signal = null;
28
29
	/**
30
	 * Processed paths
31
	 * @var string[]
32
	 */
33
	private $paths = [];
34
35
	public function __construct(Signal $signal)
36
	{
37
		$this->signal = $signal;
38
	}
39
40
	public function generate()
41
	{
42
		$extractor = $this->signal->getExtractor();
43
		$data = $extractor->getData();
44
		// TODO: Add if extractor instanceof PathsAwareInterface...
45
		$this->paths = $extractor->getPaths();
46
		$this->signal->getIO()->write($data);
47
	}
48
49
	public function getPaths()
50
	{
51
		return $this->paths;
52
	}
53
54
}
55