Receiver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 7
Bugs 2 Features 1
Metric Value
c 7
b 2
f 1
dl 0
loc 35
rs 10
wmc 3
lcom 0
cbo 1

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fromErp() 0 4 1
A fromDatabase() 0 6 1
A fromApi() 0 4 1
1
<?php namespace Algorit\Synchronizer;
2
3
use Algorit\Synchronizer\Request\RequestInterface;
4
5
class Receiver {
6
7
	/**
8
	 * Receive data from ERP
9
	 *
10
	 * @return void
11
	 */
12
	public function fromErp(RequestInterface $request, $entity, $lastSync)
13
	{
14
		return $request->receive($entity, $lastSync);
15
	}
16
17
	/**
18
	 * Get data from the Database
19
	 *
20
	 * @return void
21
	 */
22
	public function fromDatabase(RequestInterface $request, $entity, $lastSync)
23
	{
24
		return $request->getCaller()
25
					   ->repository($entity)
26
					   ->get($lastSync);
27
	}
28
29
	/**
30
	 * Receive data from a Device (Api)
31
	 *
32
	 * @return void
33
	 */
34
	public function fromApi($data)
35
	{
36
		return $data;
37
	}
38
39
}