Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmypuckett committed Mar 12, 2023
2 parents 5e6a123 + 8e9a254 commit f8d432e
Show file tree
Hide file tree
Showing 30 changed files with 121 additions and 208 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4]
php: [8.1, 8.2]
stability: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.stability }}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0
1.5.0
29 changes: 16 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
}
],
"require": {
"php": ">=7.2",
"illuminate/console": "~5.5|~6|~7|~8|~9",
"illuminate/container": "~5.5|~6|~7|~8|~9",
"illuminate/routing": "~5.5|~6|~7|~8|~9",
"illuminate/support": "~5.5|~6|~7|~8|~9",
"illuminate/view": "~5.5|~6|~7|~8|~9"
"php": "^8.1",
"illuminate/console": "~8|~9|~10",
"illuminate/container": "~8|~9|~10",
"illuminate/routing": "~8|~9|~10",
"illuminate/support": "~8|~9|~10",
"illuminate/view": "~8|~9|~10"
},
"require-dev": {
"mikey179/vfsstream": "^1.6.8",
"mockery/mockery": "^1.3.1",
"phpunit/phpunit": "^8.4|^9.0",
"psy/psysh": "^0.10",
"symfony/thanks": "^1.1",
"symfony/var-dumper": "^5.0|^6.0"
"laravel/pint": "^1.6",
"mikey179/vfsstream": "^1.6.11",
"mockery/mockery": "^1.5.1",
"phpunit/phpunit": "^9.6.5",
"psy/psysh": "^0.11.1",
"symfony/var-dumper": "^6.2"
},
"autoload": {
"psr-4": {
Expand All @@ -48,7 +48,10 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"symfony/thanks": false
}
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
16 changes: 8 additions & 8 deletions config/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
|
| The version file to read relative to the base path.
*/
'file' => 'VERSION',
'file' => 'VERSION',

/*
|--------------------------------------------------------------------------
Expand All @@ -21,7 +21,7 @@
'route' => [

// Expose a route?
'enabled' => true,
'enabled' => true,

// What to expose on the route. Possible values...
// * major
Expand All @@ -31,16 +31,16 @@
// * pre_release
// * semver
// * version
'expose' => 'semver',
'expose' => 'semver',

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

// Name of route
'name' => 'version',
'name' => 'version',

// URI to reach the version
'uri' => '/version',
'uri' => '/version',

],

Expand All @@ -51,17 +51,17 @@
|
| Attach an instance of the Version object to the view.
*/
'view' => [
'view' => [

// Add the view composer?
'enabled' => true,
'enabled' => true,

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

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

],

Expand Down
5 changes: 0 additions & 5 deletions nitpick.json

This file was deleted.

6 changes: 6 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"preset": "laravel",
"rules": {
"no_superfluous_phpdoc_tags": true
}
}
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ There are many times that it is nice to know the version of your application. A

## Prerequisite

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

## Install

Expand Down Expand Up @@ -63,7 +63,7 @@ Some notes about the file...
* We assume that the first line is only `major`.`minor`.`patch`
* The first non-empty line after the version will become the `pre_release`
* If `pre_release` is `master`, then it gets ignored
* 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
* 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

## Using the package

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

#### Route

Visiting `/version` will return the version...
Expand Down
6 changes: 1 addition & 5 deletions src/Commands/MajorVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

/**
* Class MajorVersionCommand
*
* @package Spinen\Version\Commands
*/
class MajorVersionCommand extends VersionCommand
{
Expand All @@ -25,10 +23,8 @@ class MajorVersionCommand extends VersionCommand

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(): void
{
$this->info($this->version->major);
}
Expand Down
6 changes: 1 addition & 5 deletions src/Commands/MetaVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

/**
* Class MetaVersionCommand
*
* @package Spinen\Version\Commands
*/
class MetaVersionCommand extends VersionCommand
{
Expand All @@ -25,10 +23,8 @@ class MetaVersionCommand extends VersionCommand

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(): void
{
$this->info($this->version->meta);
}
Expand Down
6 changes: 1 addition & 5 deletions src/Commands/MinorVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

/**
* Class MinorVersionCommand
*
* @package Spinen\Version\Commands
*/
class MinorVersionCommand extends VersionCommand
{
Expand All @@ -25,10 +23,8 @@ class MinorVersionCommand extends VersionCommand

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(): void
{
$this->info($this->version->minor);
}
Expand Down
6 changes: 1 addition & 5 deletions src/Commands/PatchVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

/**
* Class PatchVersionCommand
*
* @package Spinen\Version\Commands
*/
class PatchVersionCommand extends VersionCommand
{
Expand All @@ -25,10 +23,8 @@ class PatchVersionCommand extends VersionCommand

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(): void
{
$this->info($this->version->patch);
}
Expand Down
6 changes: 1 addition & 5 deletions src/Commands/PreReleaseVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

/**
* Class PreReleaseVersionCommand
*
* @package Spinen\Version\Commands
*/
class PreReleaseVersionCommand extends VersionCommand
{
Expand All @@ -25,10 +23,8 @@ class PreReleaseVersionCommand extends VersionCommand

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(): void
{
$this->info($this->version->pre_release);
}
Expand Down
6 changes: 1 addition & 5 deletions src/Commands/SemVersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

/**
* Class SemVersionCommand
*
* @package Spinen\Version\Commands
*/
class SemVersionCommand extends VersionCommand
{
Expand All @@ -25,10 +23,8 @@ class SemVersionCommand extends VersionCommand

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(): void
{
$this->info($this->version->semver);
}
Expand Down
12 changes: 2 additions & 10 deletions src/Commands/VersionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

/**
* Class VersionCommand
*
* @package Spinen\Version\Commands
*/
class VersionCommand extends Command
{
Expand All @@ -28,15 +26,11 @@ class VersionCommand extends Command

/**
* The Version instance
*
* @var Version
*/
protected $version;
protected Version $version;

/**
* Create a new command instance.
*
* @param Version $version
*/
public function __construct(Version $version)
{
Expand All @@ -47,10 +41,8 @@ public function __construct(Version $version)

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(): void
{
$this->info($this->version->version);
}
Expand Down
11 changes: 2 additions & 9 deletions src/Http/Controllers/VersionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,14 @@

/**
* Class VersionController
*
* @package Spinen\Version\Http\Controllers
*/
class VersionController extends Controller
{
/**
* Return the semver
*
* @param Config $config
* @param Version $version
*
* @return string
*/
public function version(Config $config, Version $version)
public function version(Config $config, Version $version): string
{
return $version->{$config->get('version.route.expose', 'semver')} . " Hostname: " . gethostname();
return $version->{$config->get('version.route.expose', 'semver')}.' Hostname: '.gethostname();
}
}
Loading

0 comments on commit f8d432e

Please sign in to comment.