#451 PHPStan level 5

This commit is contained in:
Roland Gruber 2025-09-04 17:33:44 +02:00
parent a02ee14330
commit 7aa468aa75
4 changed files with 13 additions and 13 deletions

View file

@ -2,7 +2,7 @@
/* /*
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
Copyright (C) 2013 - 2024 Roland Gruber Copyright (C) 2013 - 2025 Roland Gruber
This program is free software; you can redistribute it and/or modify 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 it under the terms of the GNU General Public License as published by
@ -270,7 +270,7 @@ class pykotaPrinter extends baseModule {
if ($parentPrinters !== []) { if ($parentPrinters !== []) {
$container->addLabel(new htmlOutputText(_('Printer groups'))); $container->addLabel(new htmlOutputText(_('Printer groups')));
$parentPrinterText = new htmlOutputText(implode(', ', $parentPrinters)); $parentPrinterText = new htmlOutputText(implode(', ', $parentPrinters));
$container->addField($parentPrinterText, true); $container->addField($parentPrinterText);
} }
} }
// printer members // printer members

View file

@ -565,7 +565,7 @@ class pykotaUser extends baseModule {
$totalPaidGroup->addElement(new htmlOutputText($total)); $totalPaidGroup->addElement(new htmlOutputText($total));
$totalPaidGroup->addElement(new htmlSpacer('0.5rem', null)); $totalPaidGroup->addElement(new htmlSpacer('0.5rem', null));
$totalPaidGroup->addElement(new htmlHelpLink('pykotaLifeTimePaid')); $totalPaidGroup->addElement(new htmlHelpLink('pykotaLifeTimePaid'));
$container->addField($totalPaidGroup, 12); $container->addField($totalPaidGroup);
// payment/job history // payment/job history
if (!empty($this->attributes['pykotaPayments'][0])) { if (!empty($this->attributes['pykotaPayments'][0])) {
$container->add(new htmlSubTitle(_('Payment history'))); $container->add(new htmlSubTitle(_('Payment history')));

View file

@ -1392,7 +1392,7 @@ class sambaSamAccount extends baseModule implements passwordService, AccountStat
elseif ($hr >= 24 * 7) { elseif ($hr >= 24 * 7) {
$hr -= 24 * 7; $hr -= 24 * 7;
} }
$checkbox = new htmlInputCheckbox('lh_' . $hr, $hour[$hr]); $checkbox = new htmlInputCheckbox('lh_' . $hr, (bool) $hour[$hr]);
$boxes[$i % 24][floor($i / 24)] = $checkbox; $boxes[$i % 24][floor($i / 24)] = $checkbox;
} }
for ($h = 0; $h < 24; $h++) { for ($h = 0; $h < 24; $h++) {
@ -1601,7 +1601,7 @@ class sambaSamAccount extends baseModule implements passwordService, AccountStat
if ($returnValue === 'ok') { if ($returnValue === 'ok') {
$return->addLabel(new htmlOutputText($label)); $return->addLabel(new htmlOutputText($label));
$editGroup = new htmlGroup(); $editGroup = new htmlGroup();
$editGroup->addElement(new htmlImage('../../graphics/pass.svg', 16, 16)); $editGroup->addElement(new htmlImage('../../graphics/pass.svg', '16', '16'));
$editGroup->addElement(new htmlSpacer('0.5rem', null)); $editGroup->addElement(new htmlSpacer('0.5rem', null));
$editGroup->addElement(new htmlAccountPageButton(static::class, 'homedir', 'delete_' . $i, _('Delete'))); $editGroup->addElement(new htmlAccountPageButton(static::class, 'homedir', 'delete_' . $i, _('Delete')));
$return->addField($editGroup); $return->addField($editGroup);
@ -1609,7 +1609,7 @@ class sambaSamAccount extends baseModule implements passwordService, AccountStat
elseif ($returnValue === 'missing') { elseif ($returnValue === 'missing') {
$return->addLabel(new htmlOutputText($label)); $return->addLabel(new htmlOutputText($label));
$editGroup = new htmlGroup(); $editGroup = new htmlGroup();
$editGroup->addElement(new htmlImage('../../graphics/del.svg', 16, 16)); $editGroup->addElement(new htmlImage('../../graphics/del.svg', '16', '16'));
$editGroup->addElement(new htmlSpacer('0.5rem', null)); $editGroup->addElement(new htmlSpacer('0.5rem', null));
$editGroup->addElement(new htmlAccountPageButton(static::class, 'homedir', 'create_' . $i, _('Create'))); $editGroup->addElement(new htmlAccountPageButton(static::class, 'homedir', 'create_' . $i, _('Create')));
$return->addField($editGroup); $return->addField($editGroup);
@ -1749,7 +1749,7 @@ class sambaSamAccount extends baseModule implements passwordService, AccountStat
$expireContainer->add(new htmlSelect('sambaSamAccount_expire_mon', $mon, ['1']), 2, 2, 2, 'padding-left-right05'); $expireContainer->add(new htmlSelect('sambaSamAccount_expire_mon', $mon, ['1']), 2, 2, 2, 'padding-left-right05');
$expireContainer->add(new htmlSelect('sambaSamAccount_expire_yea', $year, ['2030']), 6, 6, 6, 'padding-left-right05'); $expireContainer->add(new htmlSelect('sambaSamAccount_expire_yea', $year, ['2030']), 6, 6, 6, 'padding-left-right05');
$expireContainer->add(new htmlHelpLink('expireDate'), 2, 2, 2, 'padding-left-right05'); $expireContainer->add(new htmlHelpLink('expireDate'), 2, 2, 2, 'padding-left-right05');
$return->addField($expireContainer, 12); $return->addField($expireContainer);
if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideHomeDrive')) { if (!$this->isBooleanConfigOptionSet('sambaSamAccount_hideHomeDrive')) {
// letter of home drive // letter of home drive
$drives = ['-']; $drives = ['-'];
@ -1780,7 +1780,7 @@ class sambaSamAccount extends baseModule implements passwordService, AccountStat
for ($i = 0; $i < count($sambaDomains); $i++) { for ($i = 0; $i < count($sambaDomains); $i++) {
$sambaDomainNames[] = $sambaDomains[$i]->name; $sambaDomainNames[] = $sambaDomains[$i]->name;
} }
$return->add(new htmlResponsiveSelect('sambaSamAccount_sambaDomainName', $sambaDomainNames, null, _('Domain'), 'domain')); $return->add(new htmlResponsiveSelect('sambaSamAccount_sambaDomainName', $sambaDomainNames, [], _('Domain'), 'domain'));
// Windows group // Windows group
$groups = []; $groups = [];
foreach ($this->groupRids as $key => $value) { foreach ($this->groupRids as $key => $value) {
@ -1802,7 +1802,7 @@ class sambaSamAccount extends baseModule implements passwordService, AccountStat
for ($i = 0; $i < count($sambaDomains); $i++) { for ($i = 0; $i < count($sambaDomains); $i++) {
$sambaDomainNames[] = $sambaDomains[$i]->name; $sambaDomainNames[] = $sambaDomains[$i]->name;
} }
$return->add(new htmlResponsiveSelect('sambaSamAccount_sambaDomainName', $sambaDomainNames, null, _('Domain'), 'domain')); $return->add(new htmlResponsiveSelect('sambaSamAccount_sambaDomainName', $sambaDomainNames, [], _('Domain'), 'domain'));
} }
return $return; return $return;
} }

View file

@ -750,11 +750,11 @@ class shadowAccount extends baseModule implements passwordService, AccountStatus
/** /**
* Sets the expiration date of this account. * Sets the expiration date of this account.
* If all parameters are null the expiration date will be removed. * If all parameters are null, the expiration date will be removed.
* *
* @param String $year year (e.g. 2040) * @param string|null $year year (e.g. 2040)
* @param String $month month (e.g. 8) * @param string|null $month month (e.g. 8)
* @param String $day day (e.g. 27) * @param string|null $day day (e.g. 27)
*/ */
public function setExpirationDate($year, $month, $day) { public function setExpirationDate($year, $month, $day) {
if (($year == null) && ($month == null) && ($day == null)) { if (($year == null) && ($month == null) && ($day == null)) {