Memory::setSignal()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * This software package is licensed under `AGPL-3.0-only, proprietary` license[s].
5
 *
6
 * @package   maslosoft/signals
7
 * @license   AGPL-3.0-only, proprietary
8
 *
9
 * @copyright Copyright (c) Peter Maselkowski <[email protected]>
10
 * @link      https://maslosoft.com/signals/
11
 */
12
13
namespace Maslosoft\Signals\Builder\IO;
14
15
use Maslosoft\Signals\Interfaces\BuilderIOInterface;
16
use Maslosoft\Signals\Signal;
17
18
/**
19
 * Memory IO. It does not persist configuration.
20
 * @codeCoverageIgnore
21
 * @author Piotr Maselkowski <pmaselkowski at gmail.com>
22
 */
23
class Memory implements BuilderIOInterface
24
{
25
26
	private $data = null;
27
28
	public function read(): array
29
	{
30
		return $this->data;
31
	}
32
33
	public function setSignal(Signal $signal)
34
	{
35
36
	}
37
38
	public function write($data): bool
39
	{
40
		$this->data = $data;
41
		return true;
42
	}
43
44
}
45