Completed
Push — master ( 055479...9c7742 )
by Fumio
14:33
created

helpers.php ➔ spec()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
cc 2
eloc 5
c 3
b 0
f 0
nc 2
nop 1
dl 0
loc 10
rs 9.4285
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