StoreViewData::handle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Chriscreates\Blog\Listeners;
4
5
use Chriscreates\Blog\Events\PostViewed;
6
7
class StoreViewData
8
{
9
    /**
10
     * Handle the event.
11
     *
12
     * @param PostViewed $event
13
     * @return void
14
     */
15
    public function handle(PostViewed $event)
16
    {
17
        $event->post->increment('views');
0 ignored issues
show
Bug introduced by
The method increment() cannot be called from this context as it is declared protected in class Illuminate\Database\Eloquent\Model.

This check looks for access to methods that are not accessible from the current context.

If you need to make a method accessible to another context you can raise its visibility level in the defining class.

Loading history...
18
    }
19
}
20