phpstan
This commit is contained in:
parent
7ed2be50fd
commit
3670dc6d4b
5 changed files with 5 additions and 10 deletions
|
@ -14,6 +14,7 @@ class StoreServerDatabaseRequest extends ApplicationApiRequest
|
|||
{
|
||||
public function rules(): array
|
||||
{
|
||||
/** @var \Pterodactyl\Models\Server $server */
|
||||
$server = $this->route()->parameter('server');
|
||||
|
||||
return [
|
||||
|
|
|
@ -13,6 +13,6 @@ class DownloadFileRequest extends ClientApiRequest
|
|||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()->can('file.read', $this->parameter('server', Server::class));
|
||||
return $this->user()->can('file.read', $this->route()->parameter('server'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ class Node extends Model
|
|||
*/
|
||||
public function getConnectionAddress(): string
|
||||
{
|
||||
return sprintf('%s://%s:%s', $this->scheme, $this->fqdn, $this->daemonListen);
|
||||
return sprintf('%s://%s:%s', $this->scheme, $this->fqdn, $this->public_port_http);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,13 +30,7 @@ class NodeTransformer extends Transformer
|
|||
*/
|
||||
public function transform(Node $model): array
|
||||
{
|
||||
$response = collect($model->toArray())->mapWithKeys(function ($value, $key) {
|
||||
// I messed up early in 2016 when I named this column as poorly
|
||||
// as I did. This is the tragic result of my mistakes.
|
||||
$key = ($key === 'daemonSFTP') ? 'daemonSftp' : $key;
|
||||
|
||||
return [snake_case($key) => $value];
|
||||
})->toArray();
|
||||
$response = $model->toArray();
|
||||
|
||||
$response['created_at'] = self::formatTimestamp($model->created_at);
|
||||
$response['updated_at'] = self::formatTimestamp($model->updated_at);
|
||||
|
|
|
@ -45,7 +45,7 @@ class ServerTransformer extends Transformer
|
|||
'is_node_under_maintenance' => $server->node->isUnderMaintenance(),
|
||||
'sftp_details' => [
|
||||
'ip' => $server->node->fqdn,
|
||||
'port' => $server->node->daemonSFTP,
|
||||
'port' => $server->node->public_port_sftp,
|
||||
],
|
||||
'description' => $server->description,
|
||||
'limits' => [
|
||||
|
|
Loading…
Reference in a new issue