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

rfc3986::recipientOfNetUriAsStringIs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 18
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php namespace norsys\score\net\uri\converter\toString;
2
3
use norsys\score\{
4
	net\uri,
5
	net\uri\converter\toString,
6
	php\string\recipient
7
};
8
9
class rfc3986
10
	implements
11
		toString
12
{
13
	private
14
		$schemeConverter,
15
		$hierPartConverter
16
	;
17
18
	function __construct(uri\scheme\converter\toString $schemeConverter, uri\hierPart\converter\toString $hierPartConverter)
19
	{
20
		$this->schemeConverter = $schemeConverter;
21
		$this->hierPartConverter = $hierPartConverter;
22
	}
23
24
	function recipientOfNetUriAsStringIs(uri $uri, 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...
25
	{
26
		$uri
27
			->recipientOfNetUriSchemeAsStringFromConverterIs(
28
				$this->schemeConverter,
29
				new recipient\functor(
30
					function($scheme) use ($uri, $recipient)
31
					{
32
						$buffer = new recipient\buffer($scheme);
33
34
						$uri
35
							->recipientOfNetUriHierPartAsStringFromConverterIs(
36
								$this->hierPartConverter,
37
								new recipient\prefix(':', $buffer)
38
							)
39
						;
40
41
						$buffer->recipientOfStringIs($recipient);
42
					}
43
				)
44
			)
45
		;
46
	}
47
}
48