Completed
Push — develop ( c1be74...f8bbf2 )
by David
06:55
created

Sync_Object_Adapter_Factory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 38
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A get_instance() 0 3 1
A create() 0 3 1
1
<?php
2
3
namespace Wordlift\Dataset;
4
5
use Wordlift\Jsonld\Jsonld_Service;
6
7
class Sync_Object_Adapter_Factory {
8
	/**
9
	 * @var Sync_Object_Adapter_Factory
10
	 */
11
	private static $instance;
12
13
	/**
14
	 * @var Jsonld_Service
15
	 */
16
	private $jsonld_service;
17
18
	/**
19
	 * Sync_Object_Adapter_Factory constructor.
20
	 *
21
	 * @param $jsonld_service
22
	 */
23
	function __construct( $jsonld_service ) {
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
		$this->jsonld_service = $jsonld_service;
25
26
		self::$instance = $this;
27
	}
28
29
	static function get_instance() {
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...
30
		return self::$instance;
31
	}
32
33
	/**
34
	 * @param $type
35
	 * @param $object_id
36
	 *
37
	 * @return Sync_Object_Adapter
38
	 * @throws \Exception
39
	 */
40
	function create( $type, $object_id ) {
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...
41
		return new Sync_Object_Adapter( $type, $object_id, $this->jsonld_service );
42
	}
43
44
}
45