argument('year'); if ($year !== null && is_numeric($year) === false) { $this->error('The year must be a number'); return self::FAILURE; } $this->info('Fetching hollidays upsert shops exceptions using Api'); $job = $year !== null ? new UpsertShopsPickupExceptionsUsingApiForYear(intval($year)) : new UpsertShopsPickupExceptionsUsingApiForYear(); dispatch($job); $this->info('Done'); return self::SUCCESS; } }