Completed
Push — master ( df5bb2...a0585b )
by Frédéric
03:38
created

abempty   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 14
dl 0
loc 32
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A recipientOfSegmentInNetUriPathAsStringFromConverterIs() 0 19 1
1
<?php namespace norsys\score\net\uri\path;
2
3
use norsys\score\{
4
	net\uri\path,
5
	php\string\recipient,
6
	container\fifo,
7
	container\iterator\block\functor as block
8
};
9
10
class abempty
11
	implements
12
		path
13
{
14
	private
15
		$segments
16
	;
17
18
	function __construct(segment... $segments)
19
	{
20
		$this->segments = $segments;
21
	}
22
23
	function recipientOfSegmentInNetUriPathAsStringFromConverterIs(path\segment\converter\toString $converter, 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...
24
	{
25
		$buffer = new recipient\buffer;
26
27
		(
28
			new fifo(
29
				... $this->segments
30
			)
31
		)
32
			->blockForIteratorIs(
33
				new block(
34
					function($iterator, $segment) use ($converter, $buffer) {
35
						$converter->recipientOfSegmentInNetUriPathAsStringIs($segment, $buffer);
36
					}
37
				)
38
			)
39
		;
40
41
		$buffer->recipientOfStringIs($recipient);
42
	}
43
}
44