UploadedImage   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 1
eloc 12
dl 0
loc 30
rs 10
c 2
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
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