Passed
Push — master ( 9ff49c...6f190e )
by Bruno
15:38 queued 05:39
created

Util::getLaravelVersion()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 8
rs 10
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
    public static function getLaravelVersion(): string
13
    {
14
        $laravelVersion = '7.x'; // default
15
        if (function_exists('app')) {
16
            // @phpstan-ignore-next-line
17
            $laravelVersion = app()->version();
18
        }
19
        return $laravelVersion;
20
    }
21
}
22