summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
authorMarc Hefter <marchefter@gmail.com>2023-02-27 09:43:42 +0100
committerMarc Hefter <marchefter@gmail.com>2023-04-06 08:20:28 +0200
commitc6408587ed12634e6d5067a385a7766f3306d894 (patch)
tree744bb5fe50694133fb223430f8bbe488b0c39969 /apps/user_ldap
parentf812b8757689edf7a3c1f2751bbd106196e9fafb (diff)
downloadnextcloud-server-c6408587ed12634e6d5067a385a7766f3306d894.tar.gz
nextcloud-server-c6408587ed12634e6d5067a385a7766f3306d894.zip
fixing Psalm messages
Signed-off-by: Marc Hefter <marchefter@gmail.com>
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/lib/User/User.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/apps/user_ldap/lib/User/User.php b/apps/user_ldap/lib/User/User.php
index 93f7ff5c332..f327ec44e77 100644
--- a/apps/user_ldap/lib/User/User.php
+++ b/apps/user_ldap/lib/User/User.php
@@ -583,11 +583,6 @@ class User {
*
* @param array $profileValues associaive array of property keys and values from LDAP
* @param string|null $profileScope the scope of visibility to set
- * @var string $property the array key (property name from AccountManager class)
- * @var string $valueFromLDAP the value as read from LDAP
- * @var string $propertyValue
- * @var string $value
- * @var string $currentValue
*/
private function updateProfile(array $profileValues, ?string $profileScope=null): void {
// check if user profile was refreshed before
@@ -604,16 +599,21 @@ class User {
return;
}
// loop through the properties and handle them
+ /** @var string $property the array key (property name from AccountManager class) */
+ /** @var string $valueFromLDAP the value as read from LDAP */
foreach($profileValues as $property => $valueFromLDAP) {
- $this->logger->debug('user profile data ('.$property.') from LDAP '.$this->dn.' ='.((string)$valueFromLDAP), ['app' => 'user_ldap']);
+ $this->logger->debug('user profile data ('.$property.') from LDAP '.$this->dn, ['app' => 'user_ldap']);
// check and update profile properties
+ /** @var string $propertyValue */
$propertyValue = [$valueFromLDAP];
- if ($propertyValue && isset($propertyValue[0])) {
+ if (isset($propertyValue[0])) {
+ /** @var string $value */
$value = $propertyValue[0];
try {
+ /** @var string $currentValue */
$currentValue = (string)$user->getProfilePropertyValue($property);
if ($currentValue !== $value) {
- $user->setProfileProperty($property,$value,$scope,null);
+ $user->setProfileProperty($property,$value,$profileScope,null);
$this->logger->debug('property updated: '.$property.'='.$value.' for user '.$this->getUsername().'', ['app' => 'user_ldap']);
}
} catch (PropertyDoesNotExistException $e) {