Completed
Push — master ( 381b4d...e69b5e )
by Nicolas
02:32
created

PostWasCreated   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 3
c 3
b 0
f 2
lcom 0
cbo 0
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getEntity() 0 4 1
A getSubmissionData() 0 4 1
1
<?php
2
3
namespace Modules\Blog\Events;
4
5
use Modules\Blog\Entities\Post;
6
use Modules\Media\Contracts\StoringMedia;
7
8
class PostWasCreated implements StoringMedia
9
{
10
    /**
11
     * @var array
12
     */
13
    public $data;
14
    /**
15
     * @var Post
16
     */
17
    public $post;
18
19
    public function __construct($post, array $data)
20
    {
21
        $this->data = $data;
22
        $this->post = $post;
23
    }
24
25
    /**
26
     * Return the entity
27
     * @return \Illuminate\Database\Eloquent\Model
28
     */
29
    public function getEntity()
30
    {
31
        return $this->post;
32
    }
33
34
    /**
35
     * Return the ALL data sent
36
     * @return array
37
     */
38
    public function getSubmissionData()
39
    {
40
        return $this->data;
41
    }
42
}
43