MixpanelEvent::names()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 4
rs 10
1
<?php namespace GeneaLabs\LaravelMixpanel\Events;
2
3
use Illuminate\Queue\SerializesModels;
4
use Illuminate\Support\Collection;
5
6
class MixpanelEvent
7
{
8
    use SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by GeneaLabs\LaravelMixpanel\Events\MixpanelEvent: $id, $relations, $class, $connection, $keyBy
Loading history...
9
10
    public $charge;
11
    public $profileData;
12
    public $trackingData;
13
    public $user;
14
15
    public function __construct($user, array $trackingData, int $charge = 0, array $profileData = [])
16
    {
17
        $this->charge = $charge;
18
        $this->trackingData = $trackingData;
19
        $this->profileData = $profileData;
20
        $this->user = $user;
21
    }
22
23
    public function names() : Collection
24
    {
25
        return collect($this->trackingData)
26
            ->keys();
27
    }
28
}
29