Merge branch 'develop' into feature/react-admin

This commit is contained in:
Matthew Penner 2021-01-23 15:05:19 -07:00
commit f9bb791a7d
4 changed files with 9 additions and 33 deletions

View file

@ -51,7 +51,7 @@ jobs:
- name: install dependencies
run: composer install --prefer-dist --no-interaction --no-progress
- 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
- name: execute unit tests
run: vendor/bin/phpunit --bootstrap bootstrap/app.php tests/Unit

View file

@ -3,17 +3,9 @@
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$finder = (new Finder)->in([
'app',
'bootstrap',
'config',
'database',
'resources/lang',
'routes',
'tests',
]);
$finder = (new Finder())->in(__DIR__)->exclude(['vendor', 'node_modules', 'storage', 'bootstrap/cache']);
return (new Config)
return (new Config())
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([
@ -31,8 +23,6 @@ return (new Config)
'ordered_imports' => [
'sortAlgorithm' => 'length',
],
'psr0' => ['dir' => 'app'],
'psr4' => true,
'random_api_migration' => true,
'ternary_to_null_coalescing' => true,
'yoda_style' => [

View file

@ -7,15 +7,10 @@ use Pterodactyl\Models\Server;
class ServerConfigurationStructureService
{
/**
* @var \Pterodactyl\Services\Servers\EnvironmentService
*/
private $environment;
private EnvironmentService $environment;
/**
* ServerConfigurationStructureService constructor.
*
* @param \Pterodactyl\Services\Servers\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
* 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
{
@ -49,10 +42,8 @@ class ServerConfigurationStructureService
/**
* Returns the new data format used for the Wings daemon.
*
* @return array
*/
protected function returnCurrentFormat(Server $server)
protected function returnCurrentFormat(Server $server): array
{
return [
'uuid' => $server->uuid,
@ -89,11 +80,7 @@ class ServerConfigurationStructureService
}),
'egg' => [
'id' => $server->egg->uuid,
'file_denylist' => [
'config.yml',
'**/*.json',
],
// 'file_denylist' => explode(PHP_EOL, $server->egg->inherit_file_denylist),
'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
* that have not yet been updated.
*
* @return array
*
* @deprecated
*/
protected function returnLegacyFormat(Server $server)
protected function returnLegacyFormat(Server $server): array
{
return [
'uuid' => $server->uuid,

View file

@ -68,6 +68,7 @@
}
},
"scripts": {
"php-cs-fixer": "php-cs-fixer fix --diff --diff-format=udiff --config=./.php_cs.dist --rules=psr_autoloading",
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
@ -76,7 +77,7 @@
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
"@php artisan package:discover || true"
]
},
"prefer-stable": true,