refactoring

This commit is contained in:
Roland Gruber 2025-07-15 20:56:26 +02:00
parent d0cdf7fa94
commit ba2c727ef7
2 changed files with 9 additions and 9 deletions

View file

@ -23,7 +23,7 @@ use Webauthn\PublicKeyCredentialCreationOptions;
/* /*
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) 2017 - 2024 Roland Gruber Copyright (C) 2017 - 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
@ -1081,7 +1081,7 @@ class TwoFactorProviderService {
* *
* @param selfServiceProfile|LAMConfig $configObj profile * @param selfServiceProfile|LAMConfig $configObj profile
*/ */
public function __construct(&$configObj) { public function __construct(selfServiceProfile|LAMConfig $configObj) {
if ($configObj instanceof selfServiceProfile) { if ($configObj instanceof selfServiceProfile) {
$this->config = $this->getConfigSelfService($configObj); $this->config = $this->getConfigSelfService($configObj);
} }

View file

@ -567,9 +567,9 @@ class htmlInputField extends htmlElement {
/** /**
* Constructor * Constructor
* *
* @param String $fieldName unique field name * @param string $fieldName unique field name
* @param String $fieldValue value of input field (optional) * @param string $fieldValue value of input field (optional)
* @param String $fieldSize input field length (default 30) * @param string|null $fieldSize input field length (default 30)
*/ */
function __construct($fieldName, $fieldValue = null, $fieldSize = null) { function __construct($fieldName, $fieldValue = null, $fieldSize = null) {
if (isObfuscatedText($fieldValue)) { if (isObfuscatedText($fieldValue)) {
@ -632,15 +632,15 @@ class htmlInputField extends htmlElement {
$idValue = $this->id ?? $this->fieldName; $idValue = $this->id ?? $this->fieldName;
$id = ' id="' . $idValue . '"'; $id = ' id="' . $idValue . '"';
$value = ''; $value = '';
if ($this->fieldValue != null) { if ($this->fieldValue !== null) {
$value = ' value="' . $this->fieldValue . '"'; $value = ' value="' . $this->fieldValue . '"';
} }
$maxLength = ''; $maxLength = '';
if ($this->fieldMaxLength != null) { if ($this->fieldMaxLength !== null) {
$maxLength = ' maxlength="' . $this->fieldMaxLength . '"'; $maxLength = ' maxlength="' . $this->fieldMaxLength . '"';
} }
$size = ''; $size = '';
if ($this->fieldSize != null) { if ($this->fieldSize !== null) {
$size = ' size="' . $this->fieldSize . '"'; $size = ' size="' . $this->fieldSize . '"';
} }
$inputType = $this->type; $inputType = $this->type;
@ -777,7 +777,7 @@ class htmlInputField extends htmlElement {
/** /**
* Sets the field size (default is 30). * Sets the field size (default is 30).
* *
* @param int $fieldSize size * @param string|null $fieldSize size
*/ */
public function setFieldSize($fieldSize) { public function setFieldSize($fieldSize) {
$this->fieldSize = $fieldSize; $this->fieldSize = $fieldSize;