ProcessingProgressEvent::getDestination()   A
last analyzed

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