Skip to content

Commit

Permalink
BREAKING: increase PHP version requirement to 8.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Asnxthaony committed May 30, 2023
1 parent d96dff1 commit b811a7a
Show file tree
Hide file tree
Showing 15 changed files with 393 additions and 446 deletions.
2 changes: 1 addition & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Blessing Skin 是一个开源的 PHP 项目,这意味着您可以自由地在
Blessing Skin 对您的服务器有一定的要求。在大多数情况下,下列所需的 PHP 扩展已经开启。

- 一台支持 URL 重写的主机,Nginx 或 Apache
- PHP >= 8.0.2
- PHP >= 8.1.0
- 安装并启用如下 PHP 扩展:
- OpenSSL >= 1.1.1 (TLS 1.3)
- PDO
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Blessing Skin is an open-source project written in PHP, which means you can depl
Blessing Skin has only a few system requirements. In most cases, these PHP extensions are already enabled.

- Web server with URL rewriting enabled (Nginx or Apache)
- PHP >= 8.0.2
- PHP >= 8.1.0
- PHP Extensions
- OpenSSL >= 1.1.1 (TLS 1.3)
- PDO
Expand Down
10 changes: 3 additions & 7 deletions app/Observers/ScopeObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,21 @@ class ScopeObserver
{
/**
* Handle the Scope "saved" event.
*
* @return void
*/
public function saved()
public function saved(): void
{
$this->refreshCachedScopes();
}

/**
* Handle the Scope "deleted" event.
*
* @return void
*/
public function deleted()
public function deleted(): void
{
$this->refreshCachedScopes();
}

protected function refreshCachedScopes()
protected function refreshCachedScopes(): void
{
Cache::forget('scopes');
Cache::rememberForever('scopes', function () {
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@

class AppServiceProvider extends ServiceProvider
{
public function register()
public function register(): void
{
$this->app->singleton('cipher', 'App\Services\Cipher\\'.config('secure.cipher'));
$this->app->singleton(Services\Option::class);
$this->app->alias(Services\Option::class, 'options');
}

public function boot(Request $request)
public function boot(Request $request): void
{
Paginator::useBootstrap();

Expand Down
8 changes: 3 additions & 5 deletions app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,17 @@
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
* The model to policy mappings for the application.
*
* @var array
* @var array<class-string, class-string>
*/
protected $policies = [
];

/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
public function boot(): void
{
$defaultScopes = [
'User.Read' => 'auth.oauth.scope.user.read',
Expand Down
10 changes: 6 additions & 4 deletions app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@

class EventServiceProvider extends ServiceProvider
{
// The event listener mappings for the application.
/**
* The event to listener mappings for the application.
*
* @var array<class-string, array<int, class-string>>
*/
protected $listen = [
'App\Events\PluginWasEnabled' => [
Listeners\CopyPluginAssets::class,
Expand Down Expand Up @@ -44,10 +48,8 @@ class EventServiceProvider extends ServiceProvider

/**
* Register any events for your application.
*
* @return void
*/
public function boot()
public function boot(): void
{
Scope::observe(ScopeObserver::class);
}
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/PluginServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

class PluginServiceProvider extends ServiceProvider
{
public function register()
public function register(): void
{
$this->app->singleton(PluginManager::class);
$this->app->alias(PluginManager::class, 'plugins');
}

public function boot(PluginManager $plugins)
public function boot(PluginManager $plugins): void
{
$plugins->boot();
}
Expand Down
8 changes: 4 additions & 4 deletions app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class RouteServiceProvider extends ServiceProvider
/**
* Define the routes for the application.
*/
public function map(Router $router)
public function map(Router $router): void
{
$this->mapStaticRoutes($router);

Expand All @@ -40,7 +40,7 @@ public function map(Router $router)
* Define the "web" routes for the application.
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes(Router $router)
protected function mapWebRoutes(Router $router): void
{
Route::middleware(['web'])
->namespace($this->namespace)
Expand All @@ -51,7 +51,7 @@ protected function mapWebRoutes(Router $router)
* Define the "static" routes for the application.
* These routes will not load session, etc.
*/
protected function mapStaticRoutes(Router $router)
protected function mapStaticRoutes(Router $router): void
{
Route::namespace($this->namespace)
->group(base_path('routes/static.php'));
Expand All @@ -61,7 +61,7 @@ protected function mapStaticRoutes(Router $router)
* Define the "api" routes for the application.
* These routes are typically stateless.
*/
protected function mapApiRoutes()
protected function mapApiRoutes(): void
{
Route::prefix('api')
->middleware(
Expand Down
4 changes: 2 additions & 2 deletions app/Providers/ViewServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
namespace App\Providers;

use App\Http\View\Composers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use View;

class ViewServiceProvider extends ServiceProvider
{
public function boot()
public function boot(): void
{
View::composer([
'home',
Expand Down
2 changes: 1 addition & 1 deletion bootstrap/chkenv.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function die_with_utf8_encoding($error)
file_put_contents($envPath, preg_replace('/APP_KEY\s*=\s*/', 'APP_KEY='.$key."\n\n", $envFile));
}

$requiredVersion = '8.0.2';
$requiredVersion = '8.1.0';
preg_match('/(\d+\.\d+\.\d+)/', PHP_VERSION, $matches);
$version = $matches[1];
if (version_compare($version, $requiredVersion, '<')) {
Expand Down
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "A web application brings your custom skins back in offline Minecraft servers.",
"license": "MIT",
"require": {
"php": ">=8.0.2",
"php": "^8.1",
"ext-ctype": "*",
"ext-gd": "*",
"ext-json": "*",
Expand All @@ -28,7 +28,7 @@
"laravel/passport": "^11.0",
"lorisleiva/laravel-search-string": "^1.0",
"nesbot/carbon": "^2.0",
"nunomaduro/collision": "^6.1",
"nunomaduro/collision": "^7.0",
"rcrowe/twigbridge": "^0.14",
"spatie/laravel-translation-loader": "^2.7",
"symfony/process": "^6.0",
Expand All @@ -41,12 +41,12 @@
"barryvdh/laravel-ide-helper": "^2.10",
"fakerphp/faker": "^1.13",
"friendsofphp/php-cs-fixer": "^3.13",
"laravel/browser-kit-testing": "^6.1",
"laravel/browser-kit-testing": "^7.0",
"laravel/tinker": "^2.4",
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^9.4",
"symfony/css-selector": "^5.0",
"symfony/dom-crawler": "^5.0"
"phpunit/phpunit": "^10.0",
"symfony/css-selector": "^6.2",
"symfony/dom-crawler": "^6.2"
},
"autoload": {
"psr-4": {
Expand All @@ -70,6 +70,7 @@
]
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
Expand Down
Loading

0 comments on commit b811a7a

Please sign in to comment.