remove duplicate call to groupExists
This commit is contained in:
parent
4b603cd2f8
commit
0ba0596341
1 changed files with 4 additions and 6 deletions
|
@ -76,13 +76,8 @@ class Manager extends PublicEmitter {
|
||||||
if (isset($this->cachedGroups[$gid])) {
|
if (isset($this->cachedGroups[$gid])) {
|
||||||
return $this->cachedGroups[$gid];
|
return $this->cachedGroups[$gid];
|
||||||
}
|
}
|
||||||
foreach ($this->backends as $backend) {
|
|
||||||
if ($backend->groupExists($gid)) {
|
|
||||||
return $this->getGroupObject($gid);
|
return $this->getGroupObject($gid);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function getGroupObject($gid) {
|
protected function getGroupObject($gid) {
|
||||||
$backends = array();
|
$backends = array();
|
||||||
|
@ -91,6 +86,9 @@ class Manager extends PublicEmitter {
|
||||||
$backends[] = $backend;
|
$backends[] = $backend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (count($backends) === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
$this->cachedGroups[$gid] = new Group($gid, $backends, $this->userManager, $this);
|
$this->cachedGroups[$gid] = new Group($gid, $backends, $this->userManager, $this);
|
||||||
return $this->cachedGroups[$gid];
|
return $this->cachedGroups[$gid];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue