plugins: style sweep

This commit is contained in:
Franco Fichtner 2025-03-19 15:17:36 +01:00
parent 8d5a155553
commit ae6185094e
3 changed files with 5 additions and 6 deletions

View file

@ -187,13 +187,13 @@ class Sftp extends Base implements IBackupProvider
/**
* @return list of files on remote location
*/
private function ls($pattern='')
private function ls($pattern = '')
{
$result = [];
foreach (explode("\n", $this->sftpCmd('ls -lnt '. $pattern)['stdout']) as $line) {
foreach (explode("\n", $this->sftpCmd('ls -lnt ' . $pattern)['stdout']) as $line) {
$parts = preg_split('/\s+/', $line, -1, PREG_SPLIT_NO_EMPTY);
if (count($parts) >= 7) {
$result[] = $parts[count($parts)-1];
$result[] = $parts[count($parts) - 1];
}
}
return $result;
@ -249,7 +249,7 @@ class Sftp extends Base implements IBackupProvider
/* cleanup */
rsort($remote_backups);
if (count($remote_backups) > (int)$this->model->backupcount->getCurrentValue()) {
for ($i = $this->model->backupcount->getCurrentValue() ; $i < count($remote_backups); $i++) {
for ($i = $this->model->backupcount->getCurrentValue(); $i < count($remote_backups); $i++) {
$this->del($remote_backups[$i]);
}
$remote_backups = $this->ls('config-*.xml');

View file

@ -262,4 +262,4 @@
</field>
</tab>
<activetab>general-settings</activetab>
</form>
</form>

View file

@ -93,7 +93,6 @@ foreach ((new Caddy())->reverseproxy->reverse->iterateItems() as $reverseItem) {
if (!empty($caCertField)) {
$refs = array_map('trim', explode(',', $caCertField));
foreach ($refs as $ref) {
if (!empty($ref)) {
$caCertRefs[] = $ref;
}