MixpanelEvent   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

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

2 Methods

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