More static analysis

This commit is contained in:
Lance Pioch 2024-03-17 13:03:04 -04:00
parent 3cea8ca979
commit 861aeb0c5c
8 changed files with 8 additions and 8 deletions

View File

@ -91,7 +91,7 @@ class ServerTransferController extends Controller
$transfer->new_node = $node_id;
$transfer->old_allocation = $server->allocation_id;
$transfer->new_allocation = $allocation_id;
$transfer->old_additional_allocations = $server->allocations->where('id', '!=', $server->allocation_id)->pluck('id');
$transfer->old_additional_allocations = $server->allocations->where('id', '!=', $server->allocation_id)->pluck('id')->all();
$transfer->new_additional_allocations = $additional_allocations;
$transfer->save();

View File

@ -12,7 +12,7 @@ use Illuminate\Validation\ValidationException;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Exceptions\Model\DataValidationException;
use Illuminate\Database\Eloquent\Model as IlluminateModel;
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
use Illuminate\Validation\Factory as ValidationFactory;
use Illuminate\Validation\Validator;
abstract class Model extends IlluminateModel

View File

@ -19,6 +19,6 @@ class AllocationDeletionService
throw new ServerUsingAllocationException(trans('exceptions.allocations.server_using'));
}
return $allocation->delete();
return (int) $allocation->delete();
}
}

View File

@ -21,6 +21,6 @@ class HostDeletionService
throw new HasActiveServersException(trans('exceptions.databases.delete_has_databases'));
}
return $host->delete();
return (int) $host->delete();
}
}

View File

@ -28,6 +28,6 @@ class EggDeletionService
$egg = Egg::query()->findOrFail($egg);
return $egg->delete();
return (int) $egg->delete();
}
}

View File

@ -31,6 +31,6 @@ class NodeDeletionService
throw new HasActiveServersException($this->translator->get('exceptions.node.servers_attached'));
}
return $node->delete();
return (int) $node->delete();
}
}

View File

@ -50,7 +50,7 @@ abstract class BaseTransformer extends TransformerAbstract
/**
* Returns a new transformer instance with the request set on the instance.
*/
public static function fromRequest(Request $request): BaseTransformer
public static function fromRequest(Request $request): static
{
return app(static::class)->setRequest($request);
}

View File

@ -7,7 +7,7 @@ parameters:
- app/
# Level 9 is the highest level
level: 2
level: 3
ignoreErrors:
# Prologue\Alerts defines its methods from its configuration file dynamically