Skip to content

Commit f8d432e

Browse files
committed
Merge branch 'release/1.5.0'
2 parents 5e6a123 + 8e9a254 commit f8d432e

30 files changed

+121
-208
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: true
1414
matrix:
15-
php: [7.2, 7.3, 7.4]
15+
php: [8.1, 8.2]
1616
stability: [prefer-lowest, prefer-stable]
1717

1818
name: PHP ${{ matrix.php }} - ${{ matrix.stability }}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.0
1+
1.5.0

composer.json

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,20 @@
1515
}
1616
],
1717
"require": {
18-
"php": ">=7.2",
19-
"illuminate/console": "~5.5|~6|~7|~8|~9",
20-
"illuminate/container": "~5.5|~6|~7|~8|~9",
21-
"illuminate/routing": "~5.5|~6|~7|~8|~9",
22-
"illuminate/support": "~5.5|~6|~7|~8|~9",
23-
"illuminate/view": "~5.5|~6|~7|~8|~9"
18+
"php": "^8.1",
19+
"illuminate/console": "~8|~9|~10",
20+
"illuminate/container": "~8|~9|~10",
21+
"illuminate/routing": "~8|~9|~10",
22+
"illuminate/support": "~8|~9|~10",
23+
"illuminate/view": "~8|~9|~10"
2424
},
2525
"require-dev": {
26-
"mikey179/vfsstream": "^1.6.8",
27-
"mockery/mockery": "^1.3.1",
28-
"phpunit/phpunit": "^8.4|^9.0",
29-
"psy/psysh": "^0.10",
30-
"symfony/thanks": "^1.1",
31-
"symfony/var-dumper": "^5.0|^6.0"
26+
"laravel/pint": "^1.6",
27+
"mikey179/vfsstream": "^1.6.11",
28+
"mockery/mockery": "^1.5.1",
29+
"phpunit/phpunit": "^9.6.5",
30+
"psy/psysh": "^0.11.1",
31+
"symfony/var-dumper": "^6.2"
3232
},
3333
"autoload": {
3434
"psr-4": {
@@ -48,7 +48,10 @@
4848
}
4949
},
5050
"config": {
51-
"sort-packages": true
51+
"sort-packages": true,
52+
"allow-plugins": {
53+
"symfony/thanks": false
54+
}
5255
},
5356
"minimum-stability": "dev",
5457
"prefer-stable": true

config/version.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
|
1010
| The version file to read relative to the base path.
1111
*/
12-
'file' => 'VERSION',
12+
'file' => 'VERSION',
1313

1414
/*
1515
|--------------------------------------------------------------------------
@@ -21,7 +21,7 @@
2121
'route' => [
2222

2323
// Expose a route?
24-
'enabled' => true,
24+
'enabled' => true,
2525

2626
// What to expose on the route. Possible values...
2727
// * major
@@ -31,16 +31,16 @@
3131
// * pre_release
3232
// * semver
3333
// * version
34-
'expose' => 'semver',
34+
'expose' => 'semver',
3535

3636
// Middleware to use on the route
3737
'middleware' => 'web',
3838

3939
// Name of route
40-
'name' => 'version',
40+
'name' => 'version',
4141

4242
// URI to reach the version
43-
'uri' => '/version',
43+
'uri' => '/version',
4444

4545
],
4646

@@ -51,17 +51,17 @@
5151
|
5252
| Attach an instance of the Version object to the view.
5353
*/
54-
'view' => [
54+
'view' => [
5555

5656
// Add the view composer?
57-
'enabled' => true,
57+
'enabled' => true,
5858

5959
// What to variable name to expose the version instance as
6060
'variable' => 'version',
6161

6262
// Views to attach. "*" (default), is all views. You can pass an
6363
// array of views as well
64-
'views' => '*',
64+
'views' => '*',
6565

6666
],
6767

nitpick.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

pint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"preset": "laravel",
3+
"rules": {
4+
"no_superfluous_phpdoc_tags": true
5+
}
6+
}

readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ There are many times that it is nice to know the version of your application. A
1616

1717
## Prerequisite
1818

19-
As side from Laravel >= 5.5, there are no packages that are required.
19+
As side from Laravel >= 8, there are no packages that are required.
2020

2121
## Install
2222

@@ -63,7 +63,7 @@ Some notes about the file...
6363
* We assume that the first line is only `major`.`minor`.`patch`
6464
* The first non-empty line after the version will become the `pre_release`
6565
* If `pre_release` is `master`, then it gets ignored
66-
* All of the lines after the line being used as the `pre_release` get concatenated together with a `.` to become the `meta`, so there can be as many lines as you would like
66+
* All of the lines after the line being used as the `pre_release` get concatenated together with a `.` to become the `meta`, so there can be as many lines as you would like
6767

6868
## Using the package
6969

@@ -94,7 +94,7 @@ An instance of `\Spinen\Version\Version` is added to to all views as the `$versi
9494
* NOTE: Casting object to string is the same as `$version->semver`
9595
* Add version to footer of page
9696
* `<small class="app_version">{{ $version->version }}</small>` to get `<small class="app_version">4.3.6</small>`
97-
97+
9898
#### Route
9999

100100
Visiting `/version` will return the version...

src/Commands/MajorVersionCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
/**
66
* Class MajorVersionCommand
7-
*
8-
* @package Spinen\Version\Commands
97
*/
108
class MajorVersionCommand extends VersionCommand
119
{
@@ -25,10 +23,8 @@ class MajorVersionCommand extends VersionCommand
2523

2624
/**
2725
* Execute the console command.
28-
*
29-
* @return void
3026
*/
31-
public function handle()
27+
public function handle(): void
3228
{
3329
$this->info($this->version->major);
3430
}

src/Commands/MetaVersionCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
/**
66
* Class MetaVersionCommand
7-
*
8-
* @package Spinen\Version\Commands
97
*/
108
class MetaVersionCommand extends VersionCommand
119
{
@@ -25,10 +23,8 @@ class MetaVersionCommand extends VersionCommand
2523

2624
/**
2725
* Execute the console command.
28-
*
29-
* @return void
3026
*/
31-
public function handle()
27+
public function handle(): void
3228
{
3329
$this->info($this->version->meta);
3430
}

src/Commands/MinorVersionCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
/**
66
* Class MinorVersionCommand
7-
*
8-
* @package Spinen\Version\Commands
97
*/
108
class MinorVersionCommand extends VersionCommand
119
{
@@ -25,10 +23,8 @@ class MinorVersionCommand extends VersionCommand
2523

2624
/**
2725
* Execute the console command.
28-
*
29-
* @return void
3026
*/
31-
public function handle()
27+
public function handle(): void
3228
{
3329
$this->info($this->version->minor);
3430
}

src/Commands/PatchVersionCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
/**
66
* Class PatchVersionCommand
7-
*
8-
* @package Spinen\Version\Commands
97
*/
108
class PatchVersionCommand extends VersionCommand
119
{
@@ -25,10 +23,8 @@ class PatchVersionCommand extends VersionCommand
2523

2624
/**
2725
* Execute the console command.
28-
*
29-
* @return void
3026
*/
31-
public function handle()
27+
public function handle(): void
3228
{
3329
$this->info($this->version->patch);
3430
}

src/Commands/PreReleaseVersionCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
/**
66
* Class PreReleaseVersionCommand
7-
*
8-
* @package Spinen\Version\Commands
97
*/
108
class PreReleaseVersionCommand extends VersionCommand
119
{
@@ -25,10 +23,8 @@ class PreReleaseVersionCommand extends VersionCommand
2523

2624
/**
2725
* Execute the console command.
28-
*
29-
* @return void
3026
*/
31-
public function handle()
27+
public function handle(): void
3228
{
3329
$this->info($this->version->pre_release);
3430
}

src/Commands/SemVersionCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
/**
66
* Class SemVersionCommand
7-
*
8-
* @package Spinen\Version\Commands
97
*/
108
class SemVersionCommand extends VersionCommand
119
{
@@ -25,10 +23,8 @@ class SemVersionCommand extends VersionCommand
2523

2624
/**
2725
* Execute the console command.
28-
*
29-
* @return void
3026
*/
31-
public function handle()
27+
public function handle(): void
3228
{
3329
$this->info($this->version->semver);
3430
}

src/Commands/VersionCommand.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
/**
99
* Class VersionCommand
10-
*
11-
* @package Spinen\Version\Commands
1210
*/
1311
class VersionCommand extends Command
1412
{
@@ -28,15 +26,11 @@ class VersionCommand extends Command
2826

2927
/**
3028
* The Version instance
31-
*
32-
* @var Version
3329
*/
34-
protected $version;
30+
protected Version $version;
3531

3632
/**
3733
* Create a new command instance.
38-
*
39-
* @param Version $version
4034
*/
4135
public function __construct(Version $version)
4236
{
@@ -47,10 +41,8 @@ public function __construct(Version $version)
4741

4842
/**
4943
* Execute the console command.
50-
*
51-
* @return void
5244
*/
53-
public function handle()
45+
public function handle(): void
5446
{
5547
$this->info($this->version->version);
5648
}

src/Http/Controllers/VersionController.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,14 @@
88

99
/**
1010
* Class VersionController
11-
*
12-
* @package Spinen\Version\Http\Controllers
1311
*/
1412
class VersionController extends Controller
1513
{
1614
/**
1715
* Return the semver
18-
*
19-
* @param Config $config
20-
* @param Version $version
21-
*
22-
* @return string
2316
*/
24-
public function version(Config $config, Version $version)
17+
public function version(Config $config, Version $version): string
2518
{
26-
return $version->{$config->get('version.route.expose', 'semver')} . " Hostname: " . gethostname();
19+
return $version->{$config->get('version.route.expose', 'semver')}.' Hostname: '.gethostname();
2720
}
2821
}

0 commit comments

Comments
 (0)