Skip to content

Commit

Permalink
Merge pull request #848 from nextcloud/dependabot/composer/nextcloud/…
Browse files Browse the repository at this point in the history
…coding-standard-1.2.1

build(deps-dev): bump nextcloud/coding-standard from 1.1.1 to 1.2.1
  • Loading branch information
blizzz authored May 13, 2024
2 parents f8c93e1 + 117a302 commit f0c1f24
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
24 changes: 12 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/GroupBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0): arra
return $users;
}

public function createGroup(string $gid, string $samlGid = null): bool {
public function createGroup(string $gid, ?string $samlGid = null): bool {
try {
// Add group
$builder = $this->dbc->getQueryBuilder();
Expand Down
6 changes: 3 additions & 3 deletions lib/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ protected function assignUserToGroup(IUser $user, string $gid): void {

protected function createGroupInBackend(string $gid, ?string $originalGid = null): ?IGroup {
if ($this->groupManager instanceof PublicEmitter) {
$this->groupManager->emit('\OC\Group', 'preCreate', array($gid));
$this->groupManager->emit('\OC\Group', 'preCreate', [$gid]);
}
if (!$this->ownGroupBackend->createGroup($gid, $originalGid ?? $gid)) {
return null;
}

$group = $this->groupManager->get($gid);
if ($this->groupManager instanceof PublicEmitter) {
$this->groupManager->emit('\OC\Group', 'postCreate', array($group));
$this->groupManager->emit('\OC\Group', 'postCreate', [$group]);
}

return $group;
Expand All @@ -196,7 +196,7 @@ protected function findGroup(string $gid): IGroup {
GroupManager::LOCAL_GROUPS_CHECK_FOR_MIGRATION,
''
);
$strictBackendCheck = '' === $migrationAllowListRaw;
$strictBackendCheck = $migrationAllowListRaw === '';

$migrationAllowList = null;
if ($migrationAllowListRaw !== '') {
Expand Down
4 changes: 2 additions & 2 deletions lib/SAMLSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ public function delete(int $id): void {
* @throws Exception
*/
protected function ensureConfigurationsLoaded(int $idp = -1): void {
if (self::LOADED_ALL === $this->configurationsLoadedState
|| (self::LOADED_CHOSEN === $this->configurationsLoadedState
if ($this->configurationsLoadedState === self::LOADED_ALL
|| ($this->configurationsLoadedState === self::LOADED_CHOSEN
&& isset($this->configurations[$idp])
)
) {
Expand Down
6 changes: 3 additions & 3 deletions lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ public function createUserIfNotExists(string $uid, array $attributes = []): void
if ($home !== '') {
//if attribute's value is an absolute path take this, otherwise append it to data dir
//check for / at the beginning or pattern c:\ resp. c:/
if ('/' !== $home[0]
&& !(3 < strlen($home) && ctype_alpha($home[0])
&& $home[1] === ':' && ('\\' === $home[2] || '/' === $home[2]))
if ($home[0] !== '/'
&& !(strlen($home) > 3 && ctype_alpha($home[0])
&& $home[1] === ':' && ($home[2] === '\\' || $home[2] === '/'))
) {
$home = $this->config->getSystemValue('datadirectory',
\OC::$SERVERROOT.'/data') . '/' . $home;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/GroupBackendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

use \OCA\User_SAML\GroupBackend;
use OCA\User_SAML\GroupBackend;
use OCP\IDBConnection;
use Psr\Log\LoggerInterface;
use Test\TestCase;
Expand Down

0 comments on commit f0c1f24

Please sign in to comment.