Util::getLaravelVersion()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 8
rs 10
c 1
b 0
f 0
ccs 4
cts 5
cp 0.8
crap 2.032
1
<?php declare(strict_types=1);
2
3
namespace Modelarium\Laravel;
4
5
final class Util
6
{
7
    /**
8
     * Returns the Laravel version we're using.
9
     *
10
     * @return string
11
     */
12 9
    public static function getLaravelVersion(): string
13
    {
14 9
        $laravelVersion = '7.x'; // default
15 9
        if (function_exists('app')) {
16
            // @phpstan-ignore-next-line
17
            $laravelVersion = app()->version();
18
        }
19 9
        return $laravelVersion;
20
    }
21
}
22