• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RonasIT / laravel-empty-project / 14054813740

25 Mar 2025 08:21AM UTC coverage: 97.421%. Remained the same
14054813740

Pull #121

github

web-flow
Merge c473889b6 into 7e010bfc8
Pull Request #121: chore: update laravel version

340 of 349 relevant lines covered (97.42%)

10.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

28.57
/app/Support/Version.php
1
<?php
2

3
namespace App\Support;
4

5
use App\Enums\VersionEnum;
6
use Illuminate\Support\Arr;
7
use Illuminate\Support\Facades\Route;
8

9
class Version
10
{
11
    public static function current($pathParamName = 'version'): string
12
    {
13
        $route = Route::getRoutes()->match(request());
62✔
14

15
        return Arr::get($route->parameters(), $pathParamName) ?? str_replace('/v', '', $route->getPrefix());
62✔
16
    }
17

18
    public static function is(VersionEnum $expectedVersion): bool
19
    {
20
        return version_compare($expectedVersion->value, self::current(), '==');
×
21
    }
22

23
    public static function between(VersionEnum $from, VersionEnum $to): bool
24
    {
25
        $version = self::current();
×
26

27
        return version_compare($version, $from->value, '>=') && version_compare($version, $to->value, '<=');
×
28
    }
29

30
    public static function gte(VersionEnum $from): bool
31
    {
32
        return version_compare(self::current(), $from->value, '>=');
×
33
    }
34

35
    public static function lte(VersionEnum $to): bool
36
    {
37
        return version_compare(self::current(), $to->value, '<=');
×
38
    }
39
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc