FetchProgressEvent   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 46
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getBytesFetched() 0 4 1
A getBytesTotal() 0 4 1
1
<?php
2
3
namespace TreeHouse\Feeder\Event;
4
5
use Symfony\Component\EventDispatcher\Event;
6
7
class FetchProgressEvent extends Event
8
{
9
    /**
10
     * The number of bytes fetched so far.
11
     *
12
     * @var int
13
     */
14
    protected $bytesFetched;
15
16
    /**
17
     * The number of bytes to fetch in total.
18
     *
19
     * @var int
20
     */
21
    protected $bytesTotal;
22
23
    /**
24
     * @param int $fetched
25
     * @param int $total
26
     */
27 8
    public function __construct($fetched, $total)
28
    {
29 8
        $this->bytesFetched = $fetched;
30 8
        $this->bytesTotal = $total;
31 8
    }
32
33
    /**
34
     * Returns the total number of bytes fetched so far.
35
     *
36
     * @return int
37
     */
38 4
    public function getBytesFetched()
39
    {
40 4
        return $this->bytesFetched;
41
    }
42
43
    /**
44
     * Returns the total number of bytes to be fetched.
45
     *
46
     * @return int
47
     */
48 4
    public function getBytesTotal()
49
    {
50 4
        return $this->bytesTotal;
51
    }
52
}
53