Skip to content

Commit

Permalink
Remove unused use-statements and order them alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Jan 16, 2024
1 parent e836927 commit 987bc17
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -19,7 +19,7 @@
},
"autoload": {
"psr-4": {
"SimpleSAML\\Module\\consentsimpleadmin\\": "src/"
"SimpleSAML\\Module\\consentSimpleAdmin\\": "src/"
}
},
"autoload-dev": {
Expand All @@ -44,7 +44,8 @@
},
"allow-plugins": {
"composer/package-versions-deprecated": true,
"simplesamlphp/composer-module-installer": true
"simplesamlphp/composer-module-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
12 changes: 7 additions & 5 deletions phpunit.xml
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage>
<report>
<clover outputFile="build/logs/clover.xml"/>
<html outputDirectory="build/coverage" lowUpperBound="35" highLowerBound="70"/>
Expand All @@ -17,4 +14,9 @@
</testsuite>
</testsuites>
<logging/>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
21 changes: 12 additions & 9 deletions src/Controller/Admin.php
Expand Up @@ -2,16 +2,16 @@

declare(strict_types=1);

namespace SimpleSAML\Module\consentsimpleadmin\Controller;
namespace SimpleSAML\Module\consentSimpleAdmin\Controller;

use Exception;
use SimpleSAML\Auth;
use SimpleSAML\Configuration;
use SimpleSAML\Logger;
use SimpleSAML\Module\consent\Auth\Process\Consent;
use SimpleSAML\Session;
use SimpleSAML\Metadata\MetaDataStorageHandler;
use SimpleSAML\Module\consent\Auth\Process\Consent;
use SimpleSAML\Module\consent\Store;
use SimpleSAML\Session;
use SimpleSAML\XHTML\Template;
use Symfony\Component\HttpFoundation\Request;

Expand Down Expand Up @@ -101,9 +101,10 @@ public function admin(Request $request): Template

// Check if button with withdraw all consent was clicked
if (array_key_exists('withdraw', $_REQUEST)) {
Logger::info(
'consentAdmin: UserID [' . $hashed_user_id . '] has requested to withdraw all consents given...'
);
Logger::info(sprintf(
'consentAdmin: UserID [%s] has requested to withdraw all consents given...',
$hashed_user_id,
));

$consent_storage->deleteAllConsents($hashed_user_id);
}
Expand All @@ -116,9 +117,11 @@ public function admin(Request $request): Template
$consentServices[$c[1]] = 1;
}

Logger::debug(
'consentAdmin: no of consents [' . count($user_consent_list) . '] no of services [' . count($consentServices) . ']'
);
Logger::debug(sprintf(
'consentAdmin: no of consents [%d] no of services [%d]',
count($user_consent_list),
count($consentServices),
));

// Init template
$t = new Template($this->config, 'consentSimpleAdmin:consentadmin.twig');
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/Stats.php
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace SimpleSAML\Module\consentsimpleadmin\Controller;
namespace SimpleSAML\Module\consentSimpleAdmin\Controller;

use SimpleSAML\Configuration;
use SimpleSAML\Module\consent\Store;
Expand Down
2 changes: 1 addition & 1 deletion templates/consentadmin.twig
Expand Up @@ -10,7 +10,7 @@
<!-- <p>You have granted {{ consents }} consents to {{ consentServices }} different services.</p>
<p>If you withdraw all consents given, you will be asked again each time you visit a new service, whether or not you would like to accept that a given set of attributes are transferred.</p> -->

<form method="get" action="consentAdmin.php">
<form method="get" action="{{ moduleURL('consentSimpleAdmin/admin') }}">
<input type="submit" name="withdraw" value="{{ 'Withdraw all consent given'|trans }}" />
</form>
<!-- Withdraw all consent given -->
Expand Down
6 changes: 0 additions & 6 deletions test.php

This file was deleted.

0 comments on commit 987bc17

Please sign in to comment.