Memory   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 22
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A read() 0 4 1
A setSignal() 0 4 1
A write() 0 5 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