php::keyValueSerializerIs()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 12
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php namespace norsys\score\composer\config\platform;
2
3
use norsys\score\composer\{ config\option, part\name, part\text };
4
use norsys\score;
5
use norsys\score\php\version;
6
use norsys\score\serializer\keyValue as serializer;
7
8
class php
9
	implements
10
		constraint
11
{
12
	private
13
		$version,
14
		$converter
15
	;
16
17
	function __construct(version $version, version\converter\toString $converter = null)
18
	{
19
		$this->version = $version;
20
		$this->converter = $converter ?: new version\converter\toString\official;
21
	}
22
23
	function keyValueSerializerIs(serializer $serializer) :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
		$this->converter
26
			->recipientOfPhpVersionAsStringIs(
27
				$this->version,
28
				new score\php\string\recipient\functor(
29
					function($version) use ($serializer)
30
					{
31
						$serializer
32
							->textToSerializeWithNameIs(
33
								new name\php,
34
								new text\any($version)
35
							)
36
						;
37
					}
38
				)
39
			)
40
		;
41
	}
42
}
43