Completed
Push — master ( 660252...6055b4 )
by ARCANEDEV
13:08 queued 05:17
created

Abortable::accessNotAllowed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php namespace Arcanedev\Support\Traits;
2
3
/**
4
 * Trait     Abortable
5
 *
6
 * @package  Arcanedev\Support\Traits
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
trait Abortable
10
{
11
    /* ------------------------------------------------------------------------------------------------
12
     |  Main Functions
13
     | ------------------------------------------------------------------------------------------------
14
     */
15
    /**
16
     * Throw Page not found [404].
17
     *
18
     * @param  string  $message
19
     * @param  array   $headers
20
     */
21 9
    protected static function pageNotFound($message = 'Page not Found', array $headers = [])
22
    {
23 9
        return abort(404, $message, $headers);
24
    }
25
26
    /**
27
     * Throw AccessNotAllowed [403].
28
     *
29
     * @param  string  $message
30
     * @param  array   $headers
31
     */
32
    protected static function accessNotAllowed($message = 'Access denied !', array $headers = [])
33
    {
34
        return abort(403, $message, $headers);
35
    }
36
}
37