Skip to content

Commit de1d2d3

Browse files
author
Andrey Helldar
authored
Merge pull request #10 from TheDragonCode/3.x
Laravel 9 support
2 parents 67bff4a + 3b56f65 commit de1d2d3

File tree

3 files changed

+37
-26
lines changed

3 files changed

+37
-26
lines changed

Diff for: composer.json

+29-21
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
{
22
"name": "dragon-code/laravel-support",
33
"description": "Various helper files for the Laravel and Lumen frameworks",
4-
"type": "library",
54
"license": "MIT",
6-
"keywords": ["support", "laravel", "lumen", "framework", "dragon-code", "dragon", "andrey-helldar"],
7-
"support": {
8-
"issues": "https://github.com/TheDragonCode/laravel-support/issues",
9-
"source": "https://github.com/TheDragonCode/laravel-support"
10-
},
5+
"type": "library",
6+
"keywords": [
7+
"support",
8+
"laravel",
9+
"lumen",
10+
"framework",
11+
"dragon-code",
12+
"dragon",
13+
"andrey-helldar"
14+
],
1115
"authors": [
1216
{
1317
"name": "Andrey Helldar",
1418
"email": "[email protected]"
1519
}
1620
],
21+
"support": {
22+
"issues": "https://github.com/TheDragonCode/laravel-support/issues",
23+
"source": "https://github.com/TheDragonCode/laravel-support"
24+
},
1725
"require": {
18-
"php": "^7.2|^8.0",
19-
"illuminate/container": "^6.0|^7.0|^8.0",
20-
"illuminate/database": "^6.0|^7.0|^8.0",
21-
"illuminate/http": "^6.0|^7.0|^8.0",
22-
"illuminate/support": "^6.0|^7.0|^8.0",
23-
"ramsey/uuid": "^3.7|^4.0",
24-
"symfony/var-dumper": "^4.0|^5.0"
26+
"php": "^7.2 || ^8.0",
27+
"illuminate/container": "^6.0 || ^7.0 || ^8.0 || ^9.0",
28+
"illuminate/database": "^6.0 || ^7.0 || ^8.0 || ^9.0",
29+
"illuminate/http": "^6.0 || ^7.0 || ^8.0 || ^9.0",
30+
"illuminate/support": "^6.0 || ^7.0 || ^8.0 || ^9.0",
31+
"ramsey/uuid": "^3.7 || ^4.0",
32+
"symfony/var-dumper": "^4.0 || ^5.0 || 6.0"
2533
},
2634
"require-dev": {
27-
"laravel/framework": "^6.0|^7.0|^8.0",
28-
"laravel/lumen-framework": "^6.0|^7.0|^8.0"
35+
"laravel/framework": "^6.0 || ^7.0 || ^8.0 || ^9.0",
36+
"laravel/lumen-framework": "^6.0 || ^7.0 || ^8.0 || ^9.0"
2937
},
3038
"conflict": {
3139
"andrey-helldar/laravel-support": "*"
3240
},
41+
"suggest": {
42+
"symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers"
43+
},
44+
"minimum-stability": "stable",
45+
"prefer-stable": true,
3346
"autoload": {
3447
"psr-4": {
3548
"DragonCode\\LaravelSupport\\": "src"
@@ -38,13 +51,8 @@
3851
"helpers/dumper.php"
3952
]
4053
},
41-
"suggest": {
42-
"symfony/thanks": "Give thanks (in the form of a GitHub) to your fellow PHP package maintainers"
43-
},
4454
"config": {
4555
"preferred-install": "dist",
4656
"sort-packages": true
47-
},
48-
"minimum-stability": "stable",
49-
"prefer-stable": true
57+
}
5058
}

Diff for: src/Facades/AppVersion.php

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* @method static bool is6x()
1212
* @method static bool is7x()
1313
* @method static bool is8x()
14+
* @method static bool is9x()
1415
*/
1516
class AppVersion extends Facade
1617
{

Diff for: src/Support/AppVersion.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ public function is8x(): bool
2525
return $this->major() === 8;
2626
}
2727

28+
public function is9x(): bool
29+
{
30+
return $this->major() === 9;
31+
}
32+
2833
protected function major(): int
2934
{
3035
return (int) Str::before($this->version(), '.');
@@ -33,12 +38,9 @@ protected function major(): int
3338
protected function version(): string
3439
{
3540
if (AppHelper::isLumen()) {
36-
$version = app()->version();
37-
38-
$version = Str::after($version, '(');
39-
$version = Str::before($version, ')');
41+
preg_match('/.+\((\d+\.\d+\.\d+)\)/', app()->version(), $matches);
4042

41-
return $version;
43+
return $matches[1];
4244
}
4345

4446
return Application::VERSION;

0 commit comments

Comments
 (0)