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

rfc3986   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 19
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A recipientOfNetUriAsStringIs() 0 18 1
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