From 987bc17a88b45894899391d290c5091fec9a0087 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 16 Jan 2024 21:50:40 +0100 Subject: [PATCH] Remove unused use-statements and order them alphabetically --- composer.json | 5 +++-- phpunit.xml | 12 +++++++----- src/Controller/Admin.php | 21 ++++++++++++--------- src/Controller/Stats.php | 2 +- templates/consentadmin.twig | 2 +- test.php | 6 ------ 6 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 test.php diff --git a/composer.json b/composer.json index fc17709..77e6698 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ }, "autoload": { "psr-4": { - "SimpleSAML\\Module\\consentsimpleadmin\\": "src/" + "SimpleSAML\\Module\\consentSimpleAdmin\\": "src/" } }, "autoload-dev": { @@ -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 } } } diff --git a/phpunit.xml b/phpunit.xml index 7acc32e..a285b98 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,9 +1,6 @@ - - - - ./src - + + @@ -17,4 +14,9 @@ + + + ./src + + diff --git a/src/Controller/Admin.php b/src/Controller/Admin.php index 2f31a93..3b56a08 100644 --- a/src/Controller/Admin.php +++ b/src/Controller/Admin.php @@ -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; @@ -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); } @@ -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'); diff --git a/src/Controller/Stats.php b/src/Controller/Stats.php index 9e9277c..21e6bed 100644 --- a/src/Controller/Stats.php +++ b/src/Controller/Stats.php @@ -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; diff --git a/templates/consentadmin.twig b/templates/consentadmin.twig index a75514f..41dfd24 100644 --- a/templates/consentadmin.twig +++ b/templates/consentadmin.twig @@ -10,7 +10,7 @@ -
+
diff --git a/test.php b/test.php deleted file mode 100644 index 273a3e7..0000000 --- a/test.php +++ /dev/null @@ -1,6 +0,0 @@ -