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

Sync_Object_Adapter_Factory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
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