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

UploadStarted   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 42
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 42
loc 42
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 8 8 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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 UploadStarted
11
 * @package STS\StorageConnect\Events
12
 */
13 View Code Duplication
class UploadStarted
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
}