Completed
Push — master ( d5f261...ed671f )
by Joseph
01:44
created

UploadInProgress::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Importance

Changes 0
Metric Value
dl 8
loc 8
rs 10
c 0
b 0
f 0
nc 1
cc 1
nop 2
1
<?php
2
3
namespace STS\StorageConnect\Events;
4
5
use Illuminate\Database\Eloquent\Model;
6
use STS\StorageConnect\Models\CloudStorage;
7
use STS\StorageConnect\UploadResponse;
8
9
/**
10
 * Class UploadInProgress
11
 * @package STS\StorageConnect\Events
12
 */
13 View Code Duplication
class UploadInProgress
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
14
{
15
    /**
16
     * @var CloudStorage
17
     */
18
    public $storage;
19
20
    /**
21
     * @var string
22
     */
23
    public $sourcePath;
24
25
    /**
26
     * @var string
27
     */
28
    public $destinationPath;
29
30
    /**
31
     * @var Model
32
     */
33
    public $target;
34
35
    /**
36
     * @var UploadResponse
37
     */
38
    public $response;
39
40
    /**
41
     * UploadSucceeded constructor.
42
     *
43
     * @param CloudStorage   $storage
44
     * @param UploadResponse $response
45
     */
46
    public function __construct(CloudStorage $storage, UploadResponse $response)
47
    {
48
        $this->storage = $storage;
49
        $this->sourcePath = $response->getRequest()->getSourcePath();
50
        $this->destinationPath = $response->getRequest()->getDestinationPath();
51
        $this->target = $response->getRequest()->getTarget();
52
        $this->response = $response;
53
    }
54
}