Skip to content

Commit

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

build(deps-dev): bump nextcloud/coding-standard from 1.2.3 to 1.3.1
  • Loading branch information
blizzz authored Oct 4, 2024
2 parents 89e237b + 5de90d7 commit 4ea5899
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 41 deletions.
7 changes: 7 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# .git-blame-ignore-revs

# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

# Update to coding-standard 1.3.1
21f740715b4acea791cf14958bd1076230990e32
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ appstore: clean
--exclude=.gitattributes \
--exclude=.github \
--exclude=.gitignore \
--exclude=.git-blame-ignore-revs \
--exclude=.scrutinizer.yml \
--exclude=.travis.yml \
--exclude=.tx \
Expand Down
6 changes: 3 additions & 3 deletions appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
'message' => $l->t('This user account is disabled, please contact your administrator.')
]
);
header('Location: '.$targetUrl);
header('Location: ' . $targetUrl);
exit();
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@
'redirectUrl' => $redirectUrl
]
);
header('Location: '.$targetUrl);
header('Location: ' . $targetUrl);
exit();
}

Expand All @@ -155,6 +155,6 @@
'idp' => array_keys($configuredIdps)[0] ?? '',
]
);
header('Location: '.$targetUrl);
header('Location: ' . $targetUrl);
exit();
}
71 changes: 59 additions & 12 deletions composer.lock

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

4 changes: 2 additions & 2 deletions lib/Command/GetMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class GetMetadata extends Command {
private SAMLSettings $SAMLSettings;

public function __construct(
SAMLSettings $SAMLSettings
SAMLSettings $SAMLSettings,
) {
parent::__construct();
$this->SAMLSettings = $SAMLSettings;
Expand Down Expand Up @@ -58,7 +58,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln($metadata);
} else {
throw new Error(
'Invalid SP metadata: '.implode(', ', $errors),
'Invalid SP metadata: ' . implode(', ', $errors),
Error::METADATA_SP_INVALID
);
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/SAMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct(
UserResolver $userResolver,
UserData $userData,
ICrypto $crypto,
ITrustedDomainHelper $trustedDomainHelper
ITrustedDomainHelper $trustedDomainHelper,
) {
parent::__construct($appName, $request);
$this->session = $session;
Expand Down Expand Up @@ -283,7 +283,7 @@ public function getMetadata(int $idp = 1): Http\DataDownloadResponse {
return new Http\DataDownloadResponse($metadata, 'metadata.xml', 'text/xml');
} else {
throw new Error(
'Invalid SP metadata: '.implode(', ', $errors),
'Invalid SP metadata: ' . implode(', ', $errors),
Error::METADATA_SP_INVALID
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function __construct(
IRequest $request,
IConfig $config,
Admin $admin,
SAMLSettings $samlSettings
SAMLSettings $samlSettings,
) {
parent::__construct($appName, $request);
$this->config = $config;
Expand Down
2 changes: 1 addition & 1 deletion lib/GroupBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class GroupBackend extends ABackend implements IAddToGroupBackend, ICountUsersBa

public function __construct(
protected IDBConnection $dbc,
protected LoggerInterface $logger
protected LoggerInterface $logger,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion lib/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function __construct(
IConfig $config,
IEventDispatcher $dispatcher,
IJobList $jobList,
SAMLSettings $settings
SAMLSettings $settings,
) {
$this->db = $db;
$this->groupManager = $groupManager;
Expand Down
2 changes: 1 addition & 1 deletion lib/Middleware/OnlyLoggedInMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class OnlyLoggedInMiddleware extends Middleware {
public function __construct(
IControllerMethodReflector $reflector,
IUserSession $userSession,
IURLGenerator $urlGenerator
IURLGenerator $urlGenerator,
) {
$this->reflector = $reflector;
$this->userSession = $userSession;
Expand Down
4 changes: 3 additions & 1 deletion lib/Migration/CleanupRemovedConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@

class CleanupRemovedConfig implements IRepairStep {

public function __construct(protected IConfig $config) {
public function __construct(
protected IConfig $config,
) {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RememberLocalGroupsForPotentialMigrations implements IRepairStep {

public function __construct(
IGroupManager $groupManager,
IConfig $config
IConfig $config,
) {
$this->groupManager = $groupManager;
$this->config = $config;
Expand Down
2 changes: 1 addition & 1 deletion lib/SAMLSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function __construct(
IURLGenerator $urlGenerator,
IConfig $config,
ISession $session,
ConfigurationsMapper $mapper
ConfigurationsMapper $mapper,
) {
$this->urlGenerator = $urlGenerator;
$this->config = $config;
Expand Down
2 changes: 1 addition & 1 deletion lib/Settings/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
IL10N $l10n,
Defaults $defaults,
IConfig $config,
SAMLSettings $samlSettings
SAMLSettings $samlSettings,
) {
$this->l10n = $l10n;
$this->defaults = $defaults;
Expand Down
4 changes: 2 additions & 2 deletions lib/UserBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(
SAMLSettings $settings,
LoggerInterface $logger,
UserData $userData,
IEventDispatcher $eventDispatcher
IEventDispatcher $eventDispatcher,
) {
$this->config = $config;
$this->urlGenerator = $urlGenerator;
Expand Down Expand Up @@ -123,7 +123,7 @@ public function createUserIfNotExists(string $uid, array $attributes = []): void
&& $home[1] === ':' && ($home[2] === '\\' || $home[2] === '/'))
) {
$home = $this->config->getSystemValue('datadirectory',
\OC::$SERVERROOT.'/data') . '/' . $home;
\OC::$SERVERROOT . '/data') . '/' . $home;
}

$values['home'] = $home;
Expand Down
18 changes: 9 additions & 9 deletions templates/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@
<?php foreach ($_['general'] as $key => $attribute): ?>
<?php if ($attribute['type'] === 'checkbox' && !$attribute['global']): ?>
<p>
<input type="checkbox" data-key="<?php p($key)?>" id="user-saml-general-<?php p($key)?>" name="<?php p($key)?>" value="<?php p($_['config']['general-'.$key] ?? '0') ?>">
<input type="checkbox" data-key="<?php p($key)?>" id="user-saml-general-<?php p($key)?>" name="<?php p($key)?>" value="<?php p($_['config']['general-' . $key] ?? '0') ?>">
<label for="user-saml-general-<?php p($key)?>"><?php p($attribute['text']) ?></label><br/>
</p>
<?php elseif ($attribute['type'] === 'line' && !isset($attribute['global'])): ?>
<p>
<label for="user-saml-general-<?php p($key)?>"><?php p($attribute['text']) ?></label><br/>
<input data-key="<?php p($key)?>" id="user-saml-general-<?php p($key)?>" name="<?php p($key) ?>" value="<?php p($_['config']['general-'.$key] ?? '') ?>" type="text" <?php if (isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?> />
<input data-key="<?php p($key)?>" id="user-saml-general-<?php p($key)?>" name="<?php p($key) ?>" value="<?php p($_['config']['general-' . $key] ?? '') ?>" type="text" <?php if (isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?> />
</p>
<?php endif; ?>
<?php endforeach; ?>
Expand Down Expand Up @@ -124,7 +124,7 @@
<?php foreach ($_['sp'] as $key => $text): ?>
<p>
<label class="user-saml-standalone-label" for="user-saml-<?php p($key) ?>"><?php p($text) ?></label><br/>
<textarea id="user-saml-<?php p($key) ?>" name="<?php p($key) ?>"><?php p($_['config']['sp-'.$key] ?? '') ?></textarea>
<textarea id="user-saml-<?php p($key) ?>" name="<?php p($key) ?>"><?php p($_['config']['sp-' . $key] ?? '') ?></textarea>
</p>
<?php endforeach; ?>
</div>
Expand Down Expand Up @@ -168,7 +168,7 @@
<?php if ($attribute['type'] === 'line'): ?>
<p>
<label class="user-saml-standalone-label" for="user-saml-<?php p($key) ?>"><?php p($attribute['text']) ?></label><br/>
<input id="user-saml-<?php p($key) ?>" name="<?php p($key) ?>" value="<?php p($_['config']['saml-attribute-mapping-'.$key] ?? '') ?>" type="text" <?php if (isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?>/>
<input id="user-saml-<?php p($key) ?>" name="<?php p($key) ?>" value="<?php p($_['config']['saml-attribute-mapping-' . $key] ?? '') ?>" type="text" <?php if (isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?>/>
</p>
<?php endif; ?>
<?php endforeach; ?>
Expand All @@ -185,14 +185,14 @@
<h4><?php p($l->t('Signatures and encryption offered')) ?></h4>
<?php foreach ($_['security-offer'] as $key => $text): ?>
<p>
<input type="checkbox" id="user-saml-<?php p($key)?>" name="<?php p($key)?>" value="<?php p($_['config']['security-'.$key] ?? '0') ?>" class="checkbox">
<input type="checkbox" id="user-saml-<?php p($key)?>" name="<?php p($key)?>" value="<?php p($_['config']['security-' . $key] ?? '0') ?>" class="checkbox">
<label for="user-saml-<?php p($key)?>"><?php p($text) ?></label><br/>
</p>
<?php endforeach; ?>
<h4><?php p($l->t('Signatures and encryption required')) ?></h4>
<?php foreach ($_['security-required'] as $key => $text): ?>
<p>
<input type="checkbox" id="user-saml-<?php p($key)?>" name="<?php p($key)?>" value="<?php p($_['config']['security-'.$key] ?? '0') ?>" class="checkbox">
<input type="checkbox" id="user-saml-<?php p($key)?>" name="<?php p($key)?>" value="<?php p($_['config']['security-' . $key] ?? '0') ?>" class="checkbox">
<label for="user-saml-<?php p($key)?>"><?php p($text) ?></label>
</p>
<?php endforeach; ?>
Expand All @@ -202,12 +202,12 @@
<?php $text = $attribute['text'] ?>
<p>
<label for="user-saml-<?php p($key) ?>" class="user-saml-standalone-label"><?php p($attribute['text']) ?></label><br />
<input id="user-saml-<?php p($key) ?>" data-key="<?php p($key)?>" name="<?php p($key) ?>" value="<?php p($_['config']['security-'.$key] ?? '') ?>" type="text" <?php if (isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?> placeholder="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
<input id="user-saml-<?php p($key) ?>" data-key="<?php p($key)?>" name="<?php p($key) ?>" value="<?php p($_['config']['security-' . $key] ?? '') ?>" type="text" <?php if (isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?> placeholder="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
</p>
<?php } else { ?>
<?php $text = $attribute ?>
<p>
<input type="checkbox" id="user-saml-<?php p($key)?>" name="<?php p($key)?>" value="<?php p($_['config']['security-'.$key] ?? '0') ?>" class="checkbox">
<input type="checkbox" id="user-saml-<?php p($key)?>" name="<?php p($key)?>" value="<?php p($_['config']['security-' . $key] ?? '0') ?>" class="checkbox">
<label for="user-saml-<?php p($key)?>"><?php p($text) ?></label><br/>
</p>
<?php } ?>
Expand All @@ -227,7 +227,7 @@
<?php if ($attribute['type'] === 'line'): ?>
<p class="group">
<label for="user-saml-<?php p($key) ?>" class="user-saml-standalone-label"><?php p($attribute['text']) ?></label><br/>
<input id="user-saml-<?php p($key) ?>" name="<?php p($key) ?>" value="<?php p($_['config']['saml-user-filter-'.$key] ?? '') ?>" type="text" <?php if (isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?> placeholder="<?php p($attribute['placeholder']) ?>"/>
<input id="user-saml-<?php p($key) ?>" name="<?php p($key) ?>" value="<?php p($_['config']['saml-user-filter-' . $key] ?? '') ?>" type="text" <?php if (isset($attribute['required']) && $attribute['required'] === true): ?>class="required"<?php endif;?> placeholder="<?php p($attribute['placeholder']) ?>"/>
</p>
<?php endif; ?>
<?php endforeach; ?>
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ public function theGroupHasExactlyTheMembers(string $group, string $memberList):
public function aLocalUserWithUidExists($uid) {
shell_exec(
sprintf(
'OC_PASS=password %s %s user:add %s --display-name "Default displayname of '.$uid.'" --password-from-env',
'OC_PASS=password %s %s user:add %s --display-name "Default displayname of ' . $uid . '" --password-from-env',
PHP_BINARY,
__DIR__ . '/../../../../../../occ',
$uid
Expand All @@ -395,7 +395,7 @@ public function hackUserIntoExistence(string $uid): void {
rename(__DIR__ . '/../../../../../../data/' . $uid, __DIR__ . '/../../../../../../data/hide-' . $uid);
shell_exec(
sprintf(
'OC_PASS=password %s %s user:add %s --display-name "Default displayname of '.$uid.'" --password-from-env',
'OC_PASS=password %s %s user:add %s --display-name "Default displayname of ' . $uid . '" --password-from-env',
PHP_BINARY,
__DIR__ . '/../../../../../../occ',
$uid
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
if (!defined('PHPUNIT_RUN')) {
define('PHPUNIT_RUN', 1);
}
require_once __DIR__.'/../../../../lib/base.php';
require_once __DIR__ . '/../../../../lib/base.php';
\OC::$loader->addValidRoot(\OC::$SERVERROOT . '/tests');
\OC_App::loadApp('user_saml');
if (!class_exists('\PHPUnit\Framework\TestCase')) {
Expand Down

0 comments on commit 4ea5899

Please sign in to comment.