Skip to content

Commit 052fd45

Browse files
committed
* added AppVersion::is support for comparing specific version with current Laravel/Lumen app version
1 parent de1d2d3 commit 052fd45

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Support/AppVersion.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public function is9x(): bool
3030
return $this->major() === 9;
3131
}
3232

33+
public function is(string $version, string $comparator = '>='): bool
34+
{
35+
return version_compare($this->version(), $version, $comparator);
36+
}
37+
3338
protected function major(): int
3439
{
3540
return (int) Str::before($this->version(), '.');

0 commit comments

Comments
 (0)