Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update composer dependencies #5198

Merged
merged 15 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 5 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ jobs:
ui:
name: UI
runs-on: ubuntu-20.04
permissions:
contents: read
strategy:
fail-fast: false
matrix:
node-version: [16]
steps:
- name: Code Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ jobs:
tests:
name: Tests
runs-on: ubuntu-20.04
permissions:
contents: read
strategy:
fail-fast: false
matrix:
php: [8.1, 8.2]
database: ["mariadb:10.2", "mysql:8"]
php: [8.2, 8.3]
database:
- mariadb:10.5
- mariadb:10.11
- mariadb:11.5
- mysql:8
- mysql:9
services:
database:
image: ${{ matrix.database }}
Expand All @@ -27,18 +34,17 @@ jobs:
MYSQL_DATABASE: testing
ports:
- 3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- name: Code Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ jobs:
name: Push
runs-on: ubuntu-20.04
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
permissions:
contents: read
packages: write
steps:
- name: Code checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Docker metadata
id: docker_meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ghcr.io/pterodactyl/panel
flavor: |
Expand All @@ -35,13 +38,13 @@ jobs:
type=ref,event=branch

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
if: "github.event_name != 'pull_request'"
with:
registry: ghcr.io
Expand All @@ -56,7 +59,7 @@ jobs:
sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:1}',/" config/app.php

- name: Build and Push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
permissions:
contents: read
steps:
- name: Code Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.1"
php-version: "8.2"
extensions: bcmath, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
tools: composer:v2
coverage: none
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ jobs:
release:
name: Release
runs-on: ubuntu-20.04
permissions:
contents: write # write is required to create releases and push.
steps:
- name: Code checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
cache: "yarn"
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand All @@ -41,7 +43,7 @@ jobs:

- name: Create release archive
run: |
rm -rf node_modules tests CODE_OF_CONDUCT.md CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix
rm -rf node_modules tests CODE_OF_CONDUCT.md CONTRIBUTING.md flake.lock flake.nix phpunit.xml shell.nix
tar -czf panel.tar.gz * .editorconfig .env.example .eslintignore .eslintrc.js .gitignore .prettierrc.json

- name: Extract changelog
Expand All @@ -58,7 +60,7 @@ jobs:

- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ public/assets/manifest.json
# For local development with docker
# Remove if we ever put the Dockerfile in the repo
.dockerignore
docker-compose.yml
docker-compose.*
!docker-compose.example.yml
!docker-compose.example.yaml

# for image related files
misc
Expand All @@ -33,4 +35,3 @@ resources/lang/locales.js
/public/build
/public/hot
result
docker-compose.yaml
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use PhpCsFixer\Config;
use PhpCsFixer\Finder;
use PhpCsFixer\Runner\Parallel\ParallelConfigFactory;

$finder = (new Finder())
->in(__DIR__)
Expand All @@ -14,6 +15,7 @@
->notName(['_ide_helper*']);

return (new Config())
->setParallelConfig(ParallelConfigFactory::detect())
->setRiskyAllowed(true)
->setFinder($finder)
->setRules([
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN yarn install --frozen-lockfile \

# Stage 1:
# Build the actual container with all of the needed PHP dependencies that will run the application.
FROM --platform=$TARGETOS/$TARGETARCH php:8.1-fpm-alpine
FROM --platform=$TARGETOS/$TARGETARCH php:8.2-fpm-alpine
WORKDIR /app
COPY . ./
COPY --from=0 /app/public/assets ./public/assets
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Location/DeleteLocationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class DeleteLocationCommand extends Command
*/
public function __construct(
private LocationDeletionService $deletionService,
private LocationRepositoryInterface $repository
private LocationRepositoryInterface $repository,
) {
parent::__construct();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle()

collect($files)->each(function (\SplFileInfo $file) {
$lastModified = Carbon::createFromTimestamp($this->disk->lastModified($file->getPath()));
if ($lastModified->diffInMinutes(Carbon::now()) > self::BACKUP_THRESHOLD_MINUTES) {
if ((int) $lastModified->diffInMinutes(Carbon::now()) > self::BACKUP_THRESHOLD_MINUTES) {
$this->disk->delete($file->getPath());
$this->info(trans('command/messages.maintenance.deleting_service_backup', ['file' => $file->getFilename()]));
}
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Node/NodeConfigurationCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function handle(): int
{
$column = ctype_digit((string) $this->argument('node')) ? 'id' : 'uuid';

/** @var \Pterodactyl\Models\Node $node */
/** @var Node $node */
$node = Node::query()->where($column, $this->argument('node'))->firstOr(function () {
$this->error('The selected node does not exist.');

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Server/BulkPowerActionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(private DaemonPowerRepository $powerRepository, priv
/**
* Handle the bulk power request.
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
public function handle()
{
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/UpgradeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ public function handle()

/** @var \Illuminate\Foundation\Application $app */
$app = require __DIR__ . '/../../../bootstrap/app.php';
/** @var \Pterodactyl\Console\Kernel $kernel */
/** @var Kernel $kernel */
$kernel = $app->make(Kernel::class);
$kernel->bootstrap();
$this->setLaravel($app);
Expand Down
2 changes: 1 addition & 1 deletion app/Contracts/Extensions/HashidsInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ interface HashidsInterface extends VendorHashidsInterface
*
* @throws \InvalidArgumentException
*/
public function decodeFirst(string $encoded, string $default = null): mixed;
public function decodeFirst(string $encoded, ?string $default = null): mixed;
}
4 changes: 2 additions & 2 deletions app/Contracts/Repository/NestRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ interface NestRepositoryInterface extends RepositoryInterface
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function getWithEggs(int $id = null): Collection|Nest;
public function getWithEggs(?int $id = null): Collection|Nest;

/**
* Return a nest or all nests and the count of eggs and servers for that nest.
*
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function getWithCounts(int $id = null): Collection|Nest;
public function getWithCounts(?int $id = null): Collection|Nest;

/**
* Return a nest along with its associated eggs and the servers relation on those eggs.
Expand Down
4 changes: 2 additions & 2 deletions app/Contracts/Repository/ServerRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ public function loadEggRelations(Server $server, bool $refresh = false): Server;
/**
* Return a collection of servers with their associated data for rebuild operations.
*/
public function getDataForRebuild(int $server = null, int $node = null): Collection;
public function getDataForRebuild(?int $server = null, ?int $node = null): Collection;

/**
* Return a collection of servers with their associated data for reinstall operations.
*/
public function getDataForReinstall(int $server = null, int $node = null): Collection;
public function getDataForReinstall(?int $server = null, ?int $node = null): Collection;

/**
* Return a server model and all variables associated with the server.
Expand Down
2 changes: 1 addition & 1 deletion app/Contracts/Repository/SettingsRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ interface SettingsRepositoryInterface extends RepositoryInterface
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
*/
public function set(string $key, string $value = null);
public function set(string $key, ?string $value = null);

/**
* Retrieve a persistent setting from the database.
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/DisplayException.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function report()

try {
$logger = Container::getInstance()->make(LoggerInterface::class);
} catch (Exception) {
} catch (\Exception) {
throw $this->getPrevious();
}

Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Http/HttpForbiddenException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class HttpForbiddenException extends HttpException
/**
* HttpForbiddenException constructor.
*/
public function __construct(string $message = null, \Throwable $previous = null)
public function __construct(?string $message = null, ?\Throwable $previous = null)
{
parent::__construct(Response::HTTP_FORBIDDEN, $message, $previous);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ServerStateConflictException extends ConflictHttpException
* Exception thrown when the server is in an unsupported state for API access or
* certain operations within the codebase.
*/
public function __construct(Server $server, \Throwable $previous = null)
public function __construct(Server $server, ?\Throwable $previous = null)
{
$message = 'This server is currently in an unsupported state, please try again later.';
if ($server->isSuspended()) {
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Http/TwoFactorAuthRequiredException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TwoFactorAuthRequiredException extends HttpException implements HttpExcept
/**
* TwoFactorAuthRequiredException constructor.
*/
public function __construct(\Throwable $previous = null)
public function __construct(?\Throwable $previous = null)
{
parent::__construct(Response::HTTP_BAD_REQUEST, 'Two-factor authentication is required on this account in order to access this endpoint.', $previous);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/Service/ServiceLimitExceededException.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class ServiceLimitExceededException extends DisplayException
* Exception thrown when something goes over a defined limit, such as allocated
* ports, tasks, databases, etc.
*/
public function __construct(string $message, \Throwable $previous = null)
public function __construct(string $message, ?\Throwable $previous = null)
{
parent::__construct($message, $previous, self::LEVEL_WARNING);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Extensions/Backups/BackupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(protected Application $app)
/**
* Returns a backup adapter instance.
*/
public function adapter(string $name = null): FilesystemAdapter
public function adapter(?string $name = null): FilesystemAdapter
{
return $this->get($name ?: $this->getDefaultAdapter());
}
Expand Down
2 changes: 1 addition & 1 deletion app/Extensions/DynamicDatabaseConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DynamicDatabaseConnection
public function __construct(
protected ConfigRepository $config,
protected Encrypter $encrypter,
protected DatabaseHostRepositoryInterface $repository
protected DatabaseHostRepositoryInterface $repository,
) {
}

Expand Down
5 changes: 1 addition & 4 deletions app/Extensions/Hashids.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@

class Hashids extends VendorHashids implements HashidsInterface
{
/**
* {@inheritdoc}
*/
public function decodeFirst(string $encoded, string $default = null): mixed
public function decodeFirst(string $encoded, ?string $default = null): mixed
{
$result = $this->decode($encoded);
if (!is_array($result)) {
Expand Down
2 changes: 1 addition & 1 deletion app/Extensions/Laravel/Sanctum/NewAccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Laravel\Sanctum\NewAccessToken as SanctumAccessToken;

/**
* @property \Pterodactyl\Models\ApiKey $accessToken
* @property ApiKey $accessToken
*/
class NewAccessToken extends SanctumAccessToken
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Admin/DatabaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
private HostDeletionService $deletionService,
private HostUpdateService $updateService,
private LocationRepositoryInterface $locationRepository,
private ViewFactory $view
private ViewFactory $view,
) {
}

Expand Down
Loading
Loading