UploadFailed::__construct()   A
last analyzed

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\Exceptions\UploadException;
7
use STS\StorageConnect\Models\CloudStorage;
8
9
/**
10
 * Class UploadFailed
11
 * @package STS\StorageConnect\Events
12
 */
13 View Code Duplication
class UploadFailed
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 string
17
     */
18
    public $message;
19
    /**
20
     * @var CloudStorage
21
     */
22
    public $storage;
23
24
    /**
25
     * @var \Exception
26
     */
27
    public $exception;
28
29
    /**
30
     * @var string
31
     */
32
    public $sourcePath;
33
34
    /**
35
     * @var Model
36
     */
37
    public $target;
38
39
    /**
40
     * UploadFailed constructor.
41
     *
42
     * @param CloudStorage $storage
43
     * @param UploadException $exception
44
     */
45
    public function __construct(CloudStorage $storage, UploadException $exception )
46
    {
47
        $this->message = $exception->getMessage();
48
        $this->storage = $storage;
49
        $this->exception = $exception;
50
        $this->sourcePath = $exception->getRequest()->getSourcePath();
51
        $this->target = $exception->getRequest()->getTarget();
52
    }
53
}