Merge branch 'develop' into feature/react-admin
This commit is contained in:
commit
f9bb791a7d
|
@ -51,7 +51,7 @@ jobs:
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
run: composer install --prefer-dist --no-interaction --no-progress
|
run: composer install --prefer-dist --no-interaction --no-progress
|
||||||
- name: run cs-fixer
|
- name: run cs-fixer
|
||||||
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff
|
run: vendor/bin/php-cs-fixer fix --dry-run --diff --diff-format=udiff --rules=psr_autoloading
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
- name: execute unit tests
|
- name: execute unit tests
|
||||||
run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit
|
run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit
|
||||||
|
|
|
@ -3,17 +3,9 @@
|
||||||
use PhpCsFixer\Config;
|
use PhpCsFixer\Config;
|
||||||
use PhpCsFixer\Finder;
|
use PhpCsFixer\Finder;
|
||||||
|
|
||||||
$finder = (new Finder)->in([
|
$finder = (new Finder())->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage', 'bootstrap/cache']);
|
||||||
'app',
|
|
||||||
'bootstrap',
|
|
||||||
'config',
|
|
||||||
'database',
|
|
||||||
'resources/lang',
|
|
||||||
'routes',
|
|
||||||
'tests',
|
|
||||||
]);
|
|
||||||
|
|
||||||
return (new Config)
|
return (new Config())
|
||||||
->setRiskyAllowed(true)
|
->setRiskyAllowed(true)
|
||||||
->setFinder($finder)
|
->setFinder($finder)
|
||||||
->setRules([
|
->setRules([
|
||||||
|
@ -31,8 +23,6 @@ return (new Config)
|
||||||
'ordered_imports' => [
|
'ordered_imports' => [
|
||||||
'sortAlgorithm' => 'length',
|
'sortAlgorithm' => 'length',
|
||||||
],
|
],
|
||||||
'psr0' => ['dir' => 'app'],
|
|
||||||
'psr4' => true,
|
|
||||||
'random_api_migration' => true,
|
'random_api_migration' => true,
|
||||||
'ternary_to_null_coalescing' => true,
|
'ternary_to_null_coalescing' => true,
|
||||||
'yoda_style' => [
|
'yoda_style' => [
|
|
@ -7,15 +7,10 @@ use Pterodactyl\Models\Server;
|
||||||
|
|
||||||
class ServerConfigurationStructureService
|
class ServerConfigurationStructureService
|
||||||
{
|
{
|
||||||
/**
|
private EnvironmentService $environment;
|
||||||
* @var \Pterodactyl\Services\Servers\EnvironmentService
|
|
||||||
*/
|
|
||||||
private $environment;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ServerConfigurationStructureService constructor.
|
* ServerConfigurationStructureService constructor.
|
||||||
*
|
|
||||||
* @param \Pterodactyl\Services\Servers\EnvironmentService $environment
|
|
||||||
*/
|
*/
|
||||||
public function __construct(EnvironmentService $environment)
|
public function __construct(EnvironmentService $environment)
|
||||||
{
|
{
|
||||||
|
@ -27,8 +22,6 @@ class ServerConfigurationStructureService
|
||||||
*
|
*
|
||||||
* DO NOT MODIFY THIS FUNCTION. This powers legacy code handling for the new Wings
|
* DO NOT MODIFY THIS FUNCTION. This powers legacy code handling for the new Wings
|
||||||
* daemon, if you modify the structure eggs will break unexpectedly.
|
* daemon, if you modify the structure eggs will break unexpectedly.
|
||||||
*
|
|
||||||
* @param bool $legacy deprecated
|
|
||||||
*/
|
*/
|
||||||
public function handle(Server $server, array $override = [], bool $legacy = false): array
|
public function handle(Server $server, array $override = [], bool $legacy = false): array
|
||||||
{
|
{
|
||||||
|
@ -49,10 +42,8 @@ class ServerConfigurationStructureService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the new data format used for the Wings daemon.
|
* Returns the new data format used for the Wings daemon.
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
protected function returnCurrentFormat(Server $server)
|
protected function returnCurrentFormat(Server $server): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'uuid' => $server->uuid,
|
'uuid' => $server->uuid,
|
||||||
|
@ -89,11 +80,7 @@ class ServerConfigurationStructureService
|
||||||
}),
|
}),
|
||||||
'egg' => [
|
'egg' => [
|
||||||
'id' => $server->egg->uuid,
|
'id' => $server->egg->uuid,
|
||||||
'file_denylist' => [
|
'file_denylist' => explode(PHP_EOL, $server->egg->inherit_file_denylist),
|
||||||
'config.yml',
|
|
||||||
'**/*.json',
|
|
||||||
],
|
|
||||||
// 'file_denylist' => explode(PHP_EOL, $server->egg->inherit_file_denylist),
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -102,11 +89,9 @@ class ServerConfigurationStructureService
|
||||||
* Returns the legacy server data format to continue support for old egg configurations
|
* Returns the legacy server data format to continue support for old egg configurations
|
||||||
* that have not yet been updated.
|
* that have not yet been updated.
|
||||||
*
|
*
|
||||||
* @return array
|
|
||||||
*
|
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
protected function returnLegacyFormat(Server $server)
|
protected function returnLegacyFormat(Server $server): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'uuid' => $server->uuid,
|
'uuid' => $server->uuid,
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist --rules=psr_autoloading",
|
||||||
"post-root-package-install": [
|
"post-root-package-install": [
|
||||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||||
],
|
],
|
||||||
|
@ -76,7 +77,7 @@
|
||||||
],
|
],
|
||||||
"post-autoload-dump": [
|
"post-autoload-dump": [
|
||||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||||
"@php artisan package:discover"
|
"@php artisan package:discover || true"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
|
|
Loading…
Reference in New Issue