Skip to content

Commit e7dba5a

Browse files
authored
Merge pull request #778 from owncloud/issue-777
[full-ci] Fixup code reported by phpstan 1.10.1
2 parents 98d6ba4 + 2dbdc14 commit e7dba5a

File tree

4 files changed

+3
-22
lines changed

4 files changed

+3
-22
lines changed

lib/Access.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@ public function shouldMapToGroupname($groupname) {
665665
}
666666
$groupBackend = $group->getBackend();
667667
$groupBackendClass = \get_class($groupBackend);
668-
/** @phpstan-ignore-next-line */
669668
if (($groupBackendClass === \OCA\User_LDAP\Group_LDAP::class || $groupBackendClass === \OCA\User_LDAP\Group_Proxy::class)
670669
&& \OC::$server->getConfig()->getAppValue('user_ldap', 'reuse_accounts', 'no') === 'yes') {
671670
// Account with same groupname exists, and matching backend, we can use this - merge
@@ -2088,7 +2087,7 @@ private function initPagedSearch($filter, $bases, $attr, $limit, $offset) {
20882087
if (!$pagedSearchOK) {
20892088
return false;
20902089
}
2091-
} else { /** @phpstan-ignore-line */
2090+
} else {
20922091
\OC::$server->getLogger()->debug(
20932092
"No paged search for us at $range",
20942093
['app' => 'user_ldap']

lib/User/Manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function getAttributes($minimal = false) {
160160
$attributes[\substr($homeRule, \strlen('attr:'))] = true;
161161
}
162162
$searchAttributes = $ldapConfig->ldapAttributesForUserSearch;
163-
if ($searchAttributes === '' || $searchAttributes === null) { /** @phpstan-ignore-line FIXME empty multiline initializes as '', make it [] */
163+
if ($searchAttributes === '' || $searchAttributes === null) { /** FIXME empty multiline initializes as '', make it [] */
164164
$searchAttributes = [];
165165
}
166166
foreach ($searchAttributes as $attr) {

lib/Wizard.php

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -719,24 +719,6 @@ private function applyFind($key, $value) {
719719
$this->configuration->setConfiguration([$key => $value]);
720720
}
721721

722-
/**
723-
* Checks, whether a port was entered in the Host configuration
724-
* field. In this case the port will be stripped off, but also stored as
725-
* setting.
726-
*/
727-
private function checkHost() {
728-
$host = $this->configuration->ldapHost;
729-
$hostInfo = \parse_url($host);
730-
731-
//removes Port from Host
732-
if (\is_array($hostInfo) && isset($hostInfo['port'])) {
733-
$port = $hostInfo['port'];
734-
$host = \str_replace(':'.$port, '', $host);
735-
$this->applyFind('ldap_host', $host);
736-
$this->applyFind('ldap_port', (string)$port);
737-
}
738-
}
739-
740722
/**
741723
* tries to detect the group member association attribute which is
742724
* one of 'uniqueMember', 'memberUid', 'member'

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ parameters:
1717
message: '#^Dead catch [^"]* is never thrown in the try block.$#'
1818
path: lib/Access.php
1919
-
20-
message: "#Strict comparison using === between non-falsy-string and '' will always evaluate to false.#"
20+
message: "#Strict comparison using === between mixed and '' will always evaluate to false.#"
2121
path: lib/Wizard.php

0 commit comments

Comments
 (0)