#451 PHPStan level 5

This commit is contained in:
Roland Gruber 2025-09-04 17:04:02 +02:00
parent 55ba56cfa2
commit 9c899f1791
4 changed files with 20 additions and 18 deletions

View file

@ -7,7 +7,7 @@ use \LAM\PDF\PDFTableRow;
/*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2011 - 2024 Roland Gruber
Copyright (C) 2011 - 2025 Roland Gruber
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -157,16 +157,16 @@ class systemQuotas extends baseModule {
// new entry
$container->addElement(new htmlInputField('path', null, 20));
$container->addElement($spacer);
$newSoftBlockInput = new htmlInputField('softBlock', 0, 10);
$newSoftBlockInput = new htmlInputField('softBlock', '0', 10);
$container->addElement($newSoftBlockInput);
$container->addElement($spacer);
$newHardBlockInput = new htmlInputField('hardBlock', 0, 10);
$newHardBlockInput = new htmlInputField('hardBlock', '0', 10);
$container->addElement($newHardBlockInput);
$container->addElement($spacer);
$newSoftInodeInput = new htmlInputField('softInode', 0, 10);
$newSoftInodeInput = new htmlInputField('softInode', '0', 10);
$container->addElement($newSoftInodeInput);
$container->addElement($spacer);
$newHardInodeInput = new htmlInputField('hardInode', 0, 10);
$newHardInodeInput = new htmlInputField('hardInode', '0', 10);
$container->addElement($newHardInodeInput);
$container->addElement(new htmlButton('add', 'add.svg', true));
return $container;
@ -242,12 +242,12 @@ class systemQuotas extends baseModule {
/**
* Checks if the quota parameters are valid.
*
* @param String $path mountpoint
* @param int $softBlock soft block limit
* @param int $hardBlock hard block limit
* @param int $softInode soft inode limit
* @param int $hardInode hard inode limit
* @param boolean $uploadIndex position is upload table
* @param string $path mountpoint
* @param string $softBlock soft block limit
* @param string $hardBlock hard block limit
* @param string $softInode soft inode limit
* @param string $hardInode hard inode limit
* @param int $uploadIndex position in upload table
* @return array array where error messages are returned
*/
private function checkQuota($path, $softBlock, $hardBlock, $softInode, $hardInode, $uploadIndex = null) {

View file

@ -200,12 +200,15 @@ class takUser extends baseModule {
if (!in_array('takUser', $partialAccounts[$i]['objectClass'])) {
$partialAccounts[$i]['objectClass'][] = 'takUser';
}
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takcallsign', 'takcallsign', 'username', $this->messages['takcallsign'][3], $errors);
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takrole', 'takrole', null, null, $errors);
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takcallsign',
'takcallsign', 'username', $this->messages['takcallsign'][3], $errors);
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takrole',
'takrole', null, [], $errors);
if (!in_array($partialAccounts[$i]['takrole'][0], self::ROLE_TYPES)) {
$errors[] = array_merge($this->messages['takrole'][0], [[$i]]);
}
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takcolor', 'takcolor', null, null, $errors);
$this->mapSimpleUploadField($rawAccounts, $ids, $partialAccounts, $i, 'takuser_takcolor',
'takcolor', null, [], $errors);
if (!in_array($partialAccounts[$i]['takcolor'][0], self::COLOR_TYPES)) {
$errors[] = array_merge($this->messages['takcolor'][0], [[$i]]);
}

View file

@ -539,7 +539,7 @@ class windowsGroup extends baseModule {
}
$this->addDoubleSelectionArea($return, _("Selected groups"), _("Available groups"), $selectedGroups,
null, $availableGroups, null, 'memberof', false, true);
[], $availableGroups, [], 'memberof', false, true);
$return->addVerticalSpacer('2rem');
$backButton = new htmlAccountPageButton(static::class, 'attributes', 'back', _('Back'));
@ -642,7 +642,6 @@ class windowsGroup extends baseModule {
$filterGroup = new htmlGroup();
$filterGroup->addElement(new htmlOutputText(_('Filter') . ' '));
$filter = new htmlInputField('windows_filter');
$filter->setFieldSize('5em');
$filter->filterSelectBox('members');
$filterGroup->addElement($filter);
$return->add($filterGroup);

View file

@ -372,8 +372,8 @@ class windowsHost extends baseModule {
/**
* Formats a value in file time (100 ns since 1601-01-01).
*
* @param integer $value time value
* @return String formatted value
* @param string $value time value
* @return string formatted value
*/
private function formatFileTime($value) {
if (empty($value) || ($value == '-1')) {