Completed
Push — master ( 94e04a...7e753b )
by C
05:18
created

ProcessingProgressEvent   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 49
ccs 19
cts 19
cp 1
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 17 3
A getSource() 0 4 1
A getDestination() 0 4 1
A getFile() 0 4 1
A getProgress() 0 4 1
1
<?php
2
namespace Tartana\Event;
3
use League\Flysystem\Adapter\AbstractAdapter;
4
use Symfony\Component\EventDispatcher\Event;
5
6
class ProcessingProgressEvent extends Event
7
{
8
9
	private $source = null;
10
11
	private $destination = null;
12
13
	private $file = null;
14
15
	private $progress = null;
16
17 10
	public function __construct (AbstractAdapter $source, AbstractAdapter $destination, $file, $progress)
18
	{
19 10
		$this->source = $source;
20 10
		$this->destination = $destination;
21 10
		$this->file = $file;
22
23 10
		$progress = (int) $progress;
24 10
		if ($progress < 0)
25
		{
26 1
			$progress = 0;
27
		}
28 10
		if ($progress > 100)
29
		{
30 1
			$progress = 100;
31
		}
32 10
		$this->progress = $progress;
33 10
	}
34
35 2
	public function getSource ()
36
	{
37 2
		return $this->source;
38
	}
39
40 1
	public function getDestination ()
41
	{
42 1
		return $this->destination;
43
	}
44
45 3
	public function getFile ()
46
	{
47 3
		return $this->file;
48
	}
49
50 6
	public function getProgress ()
51
	{
52 6
		return $this->progress;
53
	}
54
}
55