Skip to content

Commit b151366

Browse files
author
Andrey Helldar
authored
Merge pull request #12 from zaalbarxx/11-add-support-for-comparing-app-version
Support for comparing specific version with current Laravel/Lumen app version
2 parents eefb726 + e5fa92a commit b151366

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/Support/AppVersion.php

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ public function patch(): int
4949
return $version[2];
5050
}
5151

52+
public function is(string $version, string $comparator = '>='): bool
53+
{
54+
return version_compare($this->version(), $version, $comparator);
55+
}
56+
5257
public function version(): string
5358
{
5459
if (AppHelper::isLumen()) {

0 commit comments

Comments
 (0)