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

ProcessingProgressEvent::getDestination()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 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