mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-05 07:52:34 +00:00
Add phpstan level 7(#544)
This commit is contained in:
@ -11,10 +11,10 @@ class DeleteOlderMetricsCommand extends Command
|
||||
|
||||
protected $description = 'Delete older metrics from database';
|
||||
|
||||
public function handle()
|
||||
public function handle(): void
|
||||
{
|
||||
Service::query()->where('type', 'monitoring')->chunk(100, function ($services) {
|
||||
$services->each(function ($service) {
|
||||
Service::query()->where('type', 'monitoring')->chunk(100, function ($services): void {
|
||||
$services->each(function ($service): void {
|
||||
$this->info("Deleting older metrics for service {$service->server->name}");
|
||||
$service
|
||||
->server
|
||||
|
@ -15,10 +15,10 @@ class GetMetricsCommand extends Command
|
||||
public function handle(): void
|
||||
{
|
||||
$checkedMetrics = 0;
|
||||
Server::query()->whereHas('services', function (Builder $query) {
|
||||
Server::query()->whereHas('services', function (Builder $query): void {
|
||||
$query->where('type', 'monitoring')
|
||||
->where('name', 'remote-monitor');
|
||||
})->chunk(10, function ($servers) use (&$checkedMetrics) {
|
||||
})->chunk(10, function ($servers) use (&$checkedMetrics): void {
|
||||
/** @var Server $server */
|
||||
foreach ($servers as $server) {
|
||||
$info = $server->os()->resourceInfo();
|
||||
|
@ -16,9 +16,9 @@ public function handle(): void
|
||||
{
|
||||
$this->info('Migrating from Mysql to SQLite...');
|
||||
|
||||
File::exists(storage_path('database.sqlite'))
|
||||
? File::delete(storage_path('database.sqlite'))
|
||||
: null;
|
||||
if (File::exists(storage_path('database.sqlite'))) {
|
||||
File::delete(storage_path('database.sqlite'));
|
||||
}
|
||||
|
||||
File::put(storage_path('database.sqlite'), '');
|
||||
|
||||
|
@ -20,7 +20,7 @@ public function handle(): void
|
||||
Backup::query()
|
||||
->where('interval', $this->argument('interval'))
|
||||
->where('status', BackupStatus::RUNNING)
|
||||
->chunk(100, function ($backups) use (&$total) {
|
||||
->chunk(100, function ($backups) use (&$total): void {
|
||||
/** @var Backup $backup */
|
||||
foreach ($backups as $backup) {
|
||||
app(RunBackup::class)->run($backup);
|
||||
|
Reference in New Issue
Block a user