TrackTrafficListener   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 3 1
1
<?php
2
3
namespace Sfneal\Tracking\Listeners;
4
5
use Sfneal\Listeners\Listener;
6
use Sfneal\Tracking\Actions\TrackTrafficAction;
7
use Sfneal\Tracking\Events\TrackTrafficEvent;
8
9
class TrackTrafficListener extends Listener
10
{
11
    /**
12
     * TrackTrafficListener constructor.
13
     */
14
    public function __construct()
15
    {
16
        $this->onQueue(config('tracking.queue'));
17
        $this->onConnection(config('tracking.driver'));
18
    }
19
20
    /**
21
     * Retrieve tracking data and then do something with it.
22
     *
23
     * @param  TrackTrafficEvent  $event
24
     * @return void
25
     */
26
    public function handle(TrackTrafficEvent $event)
27
    {
28
        (new TrackTrafficAction($event->tracking))->execute();
29
    }
30
}
31