rfc3986::recipientOfNetUriAsStringIs()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 27
rs 9.7333
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
	php\string\provider,
8
	php\string\buffer
9
};
10
11
class rfc3986
12
	implements
13
		toString
14
{
15
	private
16
		$schemeConverter,
17
		$hierPartConverter
18
	;
19
20
	function __construct(uri\scheme\converter\toString $schemeConverter, uri\hierPart\converter\toString $hierPartConverter)
21
	{
22
		$this->schemeConverter = $schemeConverter;
23
		$this->hierPartConverter = $hierPartConverter;
24
	}
25
26
	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...
27
	{
28
		$uri
29
			->recipientOfNetUriSchemeAsStringFromConverterIs(
30
				$this->schemeConverter,
31
				new recipient\functor(
32
					function($scheme) use ($uri, $recipient)
33
					{
34
						(
35
							new buffer\infinite($scheme)
36
						)
37
							->recipientOfStringFromProviderIs(
38
								new provider\functor(
39
									function($recipient) use ($uri)
40
									{
41
										$uri
42
											->recipientOfNetUriHierPartAsStringFromConverterIs(
43
												$this->hierPartConverter,
44
												new recipient\prefix(
45
													':',
46
													$recipient
47
												)
48
											)
49
										;
50
									}
51
								),
52
								$recipient
53
							)
54
						;
55
					}
56
				)
57
			)
58
		;
59
	}
60
}
61