GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Papper   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 93
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 12
Bugs 2 Features 3
Metric Value
wmc 11
c 12
b 2
f 3
lcom 1
cbo 1
dl 0
loc 93
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A createMap() 0 4 1
A configureMapping() 0 4 1
A map() 0 4 1
A mappingOptions() 0 4 1
A validate() 0 4 1
A reset() 0 4 1
A engine() 0 5 2
A __construct() 0 3 1
A __clone() 0 3 1
A __wakeup() 0 3 1
1
<?php
2
3
namespace Papper;
4
5
use Papper\FluentSyntax\ExecuteMappingFluentSyntax;
6
use Papper\FluentSyntax\MappingFluentSyntax;
7
8
/**
9
 * Main entry point for Papper, for both creating maps and performing maps.
10
 * Static proxy to Engine.
11
 *
12
 * @author Vladimir Komissarov <[email protected]>
13
 */
14
class Papper
0 ignored issues
show
Coding Style introduced by
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
15
{
16
	/**
17
	 * Creates a TypeMap for the source's type and destination's type.
18
	 *
19
	 * @param string $sourceType Source type
20
	 * @param string $destinationType Destination type
21
	 * @return MappingFluentSyntax
22
	 */
23
	public static function createMap($sourceType, $destinationType)
24
	{
25
		return self::engine()->createMap($sourceType, $destinationType);
26
	}
27
28
	/**
29
	 * Configure mapping
30
	 *
31
	 * @param MappingConfigurationInterface $configuration
32
	 */
33
	public static function configureMapping(MappingConfigurationInterface $configuration)
34
	{
35
		self::engine()->configureMapping($configuration);
36
	}
37
38
	/**
39
	 * Initialize a mapping from the source object.
40
	 * The source type can be is inferred from the source object.
41
	 *
42
	 * @param object|object[] $source Source object or collection to map from
43
	 * @param string|null $sourceType Source object type
44
	 * @throws MappingException
45
	 * @return ExecuteMappingFluentSyntax
46
	 */
47
	public static function map($source, $sourceType = null)
48
	{
49
		return self::engine()->map($source, $sourceType);
50
	}
51
52
	/**
53
	 * Returns mapping options
54
	 *
55
	 * @return MappingOptionsInterface
56
	 */
57
	public static function mappingOptions()
58
	{
59
		return self::engine()->getMappingOptions();
60
	}
61
62
	/**
63
	 * Validates that every top level destination property is mapped to source property.
64
	 * If not, a ValidationException is thrown detailing any missing mappings.
65
	 *
66
	 * @throws ValidationException if any TypeMaps contain unmapped properties
67
	 */
68
	public static function validate()
69
	{
70
		self::engine()->validate();
71
	}
72
73
	/**
74
	 * Clear out all existing configuration
75
	 */
76
	public static function reset()
77
	{
78
		self::engine()->reset();
79
	}
80
81
	/**
82
	 * Returns engine singleton instance
83
	 *
84
	 * @return Engine
85
	 */
86
	public static function engine()
87
	{
88
		static $instance;
89
		return $instance ?: $instance = new Engine();
90
	}
91
92
	//<editor-fold desc="Singleton/Static">
93
	private function __construct()
94
	{
95
	}
96
97
	private function __clone()
98
	{
99
	}
100
101
	/** @noinspection PhpUnusedPrivateMethodInspection */
102
	private function __wakeup()
103
	{
104
	}
105
	//</editor-fold>
106
}
107