Passed
Push — master ( 9a1a68...bc76a1 )
by Iman
03:52
created

sendAndTerminate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 0
cts 1
cp 0
crap 2
rs 10
1
<?php
2
if (! function_exists('sendAndTerminate')) {
3
    /**
4
     * Get the path to the resources folder.
5
     *
6
     * @param  string  $response
7
     * @return null|\Illuminate\Contracts\Routing\ResponseFactory
8
     */
9
    function sendAndTerminate($response = null)
10
    {
11
        return respondWith($response);
12
    }
13
}
14
15
if (! function_exists('respondWith')) {
16
    /**
17
     * Get the path to the resources folder.
18
     *
19
     * @param  string  $response
20
     * @throws \ImanGhafoori\Terminator\TerminateException
21
     *
22
     * @return null|\Illuminate\Contracts\Routing\ResponseFactory
23
     */
24
    function respondWith($response = null)
25
    {
26 3
        if (is_null($response)) {
27 3
            return app(ImanGhafoori\Terminator\Responder::class);
28
        }
29 3
        app(ImanGhafoori\Terminator\Terminator::class)->respondWith($response);
30
    }
31
}