mirror of
https://github.com/pelican-dev/panel.git
synced 2026-05-04 18:00:48 +03:00
Run composer update and update model phpdocs (#2275)
This commit is contained in:
@@ -65,7 +65,7 @@ function something()
|
||||
* is assumed that the user is actually a subuser of the server.
|
||||
*
|
||||
* @param string[] $permissions
|
||||
* @return array{\App\Models\User, \App\Models\Server}
|
||||
* @return array{User, Server}
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -82,19 +82,19 @@ function createServerModel(array $attributes = []): Server
|
||||
}
|
||||
|
||||
if (!isset($attributes['owner_id'])) {
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
$attributes['owner_id'] = $user->id;
|
||||
}
|
||||
|
||||
if (!isset($attributes['node_id'])) {
|
||||
/** @var \App\Models\Node $node */
|
||||
/** @var Node $node */
|
||||
$node = Node::factory()->create();
|
||||
$attributes['node_id'] = $node->id;
|
||||
}
|
||||
|
||||
if (!isset($attributes['allocation_id'])) {
|
||||
/** @var \App\Models\Allocation $allocation */
|
||||
/** @var Allocation $allocation */
|
||||
$allocation = Allocation::factory()->create(['node_id' => $attributes['node_id']]);
|
||||
$attributes['allocation_id'] = $allocation->id;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ function createServerModel(array $attributes = []): Server
|
||||
|
||||
unset($attributes['user_id']);
|
||||
|
||||
/** @var \App\Models\Server $server */
|
||||
/** @var Server $server */
|
||||
$server = Server::factory()->create($attributes);
|
||||
|
||||
Allocation::query()->where('id', $server->allocation_id)->update(['server_id' => $server->id]);
|
||||
@@ -122,11 +122,11 @@ function createServerModel(array $attributes = []): Server
|
||||
* is assumed that the user is actually a subuser of the server.
|
||||
*
|
||||
* @param string[] $permissions
|
||||
* @return array{\App\Models\User, \App\Models\Server}
|
||||
* @return array{User, Server}
|
||||
*/
|
||||
function generateTestAccount(array $permissions = []): array
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
/** @var User $user */
|
||||
$user = User::factory()->create();
|
||||
|
||||
if (empty($permissions)) {
|
||||
@@ -154,7 +154,7 @@ function cloneEggAndVariables(Egg $egg): Egg
|
||||
$model->uuid = Uuid::uuid4()->toString();
|
||||
$model->push();
|
||||
|
||||
/** @var \App\Models\Egg $model */
|
||||
/** @var Egg $model */
|
||||
$model = $model->fresh();
|
||||
|
||||
foreach ($egg->variables as $variable) {
|
||||
@@ -170,7 +170,7 @@ function cloneEggAndVariables(Egg $egg): Egg
|
||||
*/
|
||||
function getBungeecordEgg(): Egg
|
||||
{
|
||||
/** @var \App\Models\Egg $egg */
|
||||
/** @var Egg $egg */
|
||||
$egg = Egg::query()->where('author', 'panel@example.com')->where('name', 'Bungeecord')->firstOrFail();
|
||||
|
||||
return $egg;
|
||||
|
||||
Reference in New Issue
Block a user