OkListener   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 3
Bugs 2 Features 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 28
ccs 0
cts 10
cp 0
rs 10
c 3
b 2
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 9 1
1
<?php
2
3
namespace plunner\Listeners\Caldav;
4
5
use plunner\Events\Caldav\OkEvent;
6
7
class OkListener
8
{
9
    /**
10
     * Create the event listener.
11
     *
12
     * @return void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
13
     */
14
    public function __construct()
15
    {
16
        //
17
    }
18
19
    /**
20
     * Handle the event.
21
     *
22
     * @param  OkEvent $event
23
     * @return void
24
     */
25
    public function handle(OkEvent $event)
26
    {
27
        //
28
        $calendar = $event->getCalendar();
29
        \Log::info('caldav (calendar id = ' . $calendar->calendar_id . ') correctly synchronized');
30
        //$calendar = $event->getCalendar()->fresh();
31
        $calendar->sync_errors = '';
32
        $calendar->save();
33
    }
34
}
35