OkListener::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 2
Bugs 2 Features 0
Metric Value
dl 0
loc 9
ccs 0
cts 7
cp 0
rs 9.6666
c 2
b 2
f 0
cc 1
eloc 5
nc 1
nop 1
crap 2
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