helpers.php ➔ spec()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 5
nc 2
nop 1
dl 0
loc 10
ccs 0
cts 4
cp 0
crap 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
use LaravelPlus\Extension\Specs\Factory as SpecFactory;
4
5
if (!function_exists('spec')) {
6
    /**
7
     * Get spec.
8
     *
9
     * @param string $path
10
     *
11
     * @return \LaravelPlus\Extension\Specs\Factory|LaravelPlus\Extension\Specs\InputSpec
12
     */
13
    function spec($path = null)
14
    {
15
        $factory = app(SpecFactory::class);
16
17
        if (func_num_args() == 0) {
18
            return $factory;
19
        }
20
21
        return $factory->make($path);
22
    }
23
}
24