UploadedImage::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 10
rs 10
c 2
b 0
f 0
cc 1
nc 1
nop 4
1
<?php
2
3
namespace WebDevEtc\BlogEtc\Events;
4
5
use Illuminate\Broadcasting\InteractsWithSockets;
6
use Illuminate\Foundation\Events\Dispatchable;
7
use Illuminate\Queue\SerializesModels;
8
use WebDevEtc\BlogEtc\Models\Post;
9
10
/**
11
 * Class UploadedImage.
12
 */
13
class UploadedImage
14
{
15
    use Dispatchable;
16
    use InteractsWithSockets;
17
    use SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by WebDevEtc\BlogEtc\Events\UploadedImage: $id, $relations, $class, $connection, $keyBy
Loading history...
18
19
    /** @var Post|null */
20
    public $blogEtcPost;
21
    public $image;
22
    public $source;
23
    public $image_filename;
24
25
    /**
26
     * UploadedImage constructor.
27
     *
28
     * @param $image_filename - the new filename
0 ignored issues
show
Documentation Bug introduced by
The doc comment - at position 0 could not be parsed: Unknown type name '-' at position 0 in -.
Loading history...
29
     * @param Post $blogEtcPost
30
     * @param $image
31
     * @param $source string|null  the __METHOD__  firing this event (or other string)
32
     */
33
    public function __construct(
34
        string $image_filename,
35
        $image,
36
        Post $blogEtcPost = null,
37
        string $source = 'other'
38
    ) {
39
        $this->image_filename = $image_filename;
40
        $this->blogEtcPost = $blogEtcPost;
41
        $this->image = $image;
42
        $this->source = $source;
43
    }
44
}
45