Event::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace ReliqArts\Logistiq\Tracking\Events;
6
7
use Illuminate\Queue\SerializesModels;
8
use ReliqArts\Logistiq\Tracking\Contracts\Event as EventContract;
9
use ReliqArts\Logistiq\Tracking\Contracts\Trackable;
10
11
abstract class Event implements EventContract
12
{
13
    use SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by ReliqArts\Logistiq\Tracking\Events\Event: $id, $relations, $class, $connection, $keyBy
Loading history...
14
15
    /**
16
     * @var Trackable
17
     */
18
    protected $trackable;
19
20
    /**
21
     * Event constructor.
22
     *
23
     * @param Trackable $trackable
24
     */
25
    public function __construct(Trackable $trackable)
26
    {
27
        $this->trackable = $trackable;
28
    }
29
30
    /**
31
     * @return mixed|Trackable Usually a Trackable implementation.
32
     *                         However it may return an unexpected type if \Illuminate\Queue\SerializesModels trait
33
     *                         is used by subclass.
34
     *
35
     * @see \Illuminate\Queue\SerializesModels
36
     * @see \Illuminate\Contracts\Database\ModelIdentifier
37
     */
38
    public function getTrackable()
39
    {
40
        return $this->trackable;
41
    }
42
}
43