PostWasViewed   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getPost() 0 4 1
1
<?php
2
3
namespace App\Events;
4
5
use App\Post;
6
use Illuminate\Queue\SerializesModels;
7
8
class PostWasViewed extends Event
9
{
10
    use SerializesModels;
11
12
    /**
13
     * @var Post
14
     */
15
    public $post;
16
17
    /**
18
     * PostWasViewed constructor.
19
     * @param Post $post
20
     */
21
    public function __construct(Post $post)
22
    {
23
        $this->post = $post;
24
    }
25
26
    /**
27
     * Get post model.
28
     *
29
     * @return Post
30
     */
31
    public function getPost()
32
    {
33
        return $this->post;
34
    }
35
}