provider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 20
dl 0
loc 42
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A recipientOfStringIs() 0 27 1
A __construct() 0 4 1
1
<?php namespace norsys\score\php\string\provider\suffix;
2
3
use norsys\score\php;
4
use norsys\score\php\string\{ recipient, recipient\buffer };
5
use norsys\score\container\iterator\{ fifo, block };
6
7
class provider
8
	implements
9
		php\string\provider
10
{
11
	private
12
		$suffix,
13
		$providers
14
	;
15
16
	function __construct(php\string\provider $suffix, php\string\provider... $providers)
17
	{
18
		$this->suffix = $suffix;
19
		$this->providers = $providers;
20
	}
21
22
	function recipientOfStringIs(recipient $recipient) :void
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
23
	{
24
		$buffer = new php\string\buffer\infinite;
25
26
		(
27
			new fifo
28
		)
29
			->variablesForIteratorBlockAre(
30
				new block\functor(
31
					function($iterator, $provider) use ($buffer)
32
					{
33
						$provider
34
							->recipientOfStringIs(
35
								new recipient\suffix\provider(
36
									$this->suffix,
37
									new recipient\buffer($buffer)
38
								)
39
							)
40
						;
41
42
					}
43
				),
44
				... $this->providers
45
			)
46
		;
47
48
		$buffer->recipientOfStringFromBufferIs($recipient);
49
	}
50
}
51