php   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 17
dl 0
loc 27
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A keyValueSerializerIs() 0 12 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