Test Failed
Push — ft/states ( eebc9c )
by Ben
29:42 queued 08:49
created

CheckPreviewTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 6
c 0
b 0
f 0
dl 0
loc 9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A isPreviewAllowed() 0 7 2
1
<?php
2
3
namespace Thinktomorrow\Chief\States\Publishable;
4
5
use Illuminate\Support\Facades\Session;
6
7
trait CheckPreviewTrait
8
{
9
    public function isPreviewAllowed()
10
    {
11
        if (PreviewMode::fromRequest()->check()) {
12
            Session::now('note.default', 'U bekijkt een preview.');
13
            return true;
14
        } else {
15
            return false;
16
        }
17
    }
18
}
19