StoreViewData   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 13
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 4 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