diff --git a/composer.json b/composer.json index 6eae5a81..7b8d8eb9 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ }, "allow-plugins": { "composer/package-versions-deprecated": true, - "simplesamlphp/composer-module-installer": true + "simplesamlphp/composer-module-installer": true, + "dealerdirect/phpcodesniffer-composer-installer": true } }, "autoload": { @@ -26,10 +27,10 @@ } }, "require": { - "php": "^8.0", + "php": "^8.1", "simplesamlphp/composer-module-installer": "^1.3.4", - "simplesamlphp/simplesamlphp": "^3@dev", + "simplesamlphp/simplesamlphp": "^2.1", "simplesamlphp/xml-cas": "^1.0.3", "simplesamlphp/xml-common": "^1.12.2", "simplesamlphp/xml-soap": "^1.3.0" diff --git a/phpcs.xml b/phpcs.xml index 830c227f..511ab865 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -6,7 +6,7 @@ By default it is less stringent about long lines than other coding standards - config-templates + config public src templates diff --git a/public/cas.php b/public/cas.php index 22271dab..6c9f6028 100644 --- a/public/cas.php +++ b/public/cas.php @@ -26,6 +26,8 @@ * */ +declare(strict_types=1); + $validFunctions = [ 'login' => 'login', 'validate' => 'validate', diff --git a/public/loggedIn.php b/public/loggedIn.php index 0ca209ec..295f4821 100644 --- a/public/loggedIn.php +++ b/public/loggedIn.php @@ -21,6 +21,8 @@ * */ +declare(strict_types=1); + session_cache_limiter('nocache'); $globalConfig = \SimpleSAML\Configuration::getInstance(); diff --git a/public/loggedOut.php b/public/loggedOut.php index cb5430eb..20330c68 100644 --- a/public/loggedOut.php +++ b/public/loggedOut.php @@ -21,6 +21,8 @@ * */ +declare(strict_types=1); + session_cache_limiter('nocache'); $globalConfig = \SimpleSAML\Configuration::getInstance(); diff --git a/public/login.php b/public/login.php index 7adfa082..dfc3c74e 100644 --- a/public/login.php +++ b/public/login.php @@ -28,15 +28,15 @@ * language */ -use SimpleSAML\Module\casserver\Cas\AttributeExtractor; -use SimpleSAML\Module\casserver\Cas\Protocol\SamlValidateResponder; -use SimpleSAML\Module\casserver\Cas\ServiceValidator; -use SimpleSAML\Module\casserver\Cas\Ticket\TicketFactory; -use SimpleSAML\Module\casserver\Cas\Ticket\TicketStore; +declare(strict_types=1); + use SimpleSAML\Configuration; use SimpleSAML\Locale\Language; use SimpleSAML\Logger; use SimpleSAML\Module; +use SimpleSAML\Module\casserver\Cas\AttributeExtractor; +use SimpleSAML\Module\casserver\Cas\Protocol\SamlValidateResponder; +use SimpleSAML\Module\casserver\Cas\ServiceValidator; use SimpleSAML\Session; use SimpleSAML\Utils; diff --git a/public/logout.php b/public/logout.php index 6a3b2e23..64307f0c 100644 --- a/public/logout.php +++ b/public/logout.php @@ -23,6 +23,8 @@ * url - optional if a logout page is displayed */ +declare(strict_types=1); + /* Load simpleSAMLphp, configuration and metadata */ $casconfig = \SimpleSAML\Configuration::getConfig('module_casserver.php'); diff --git a/public/proxy.php b/public/proxy.php index 7c0584b5..f7cc5729 100644 --- a/public/proxy.php +++ b/public/proxy.php @@ -25,6 +25,8 @@ * */ +declare(strict_types=1); + require_once('utility/urlUtils.php'); $casconfig = \SimpleSAML\Configuration::getConfig('module_casserver.php'); diff --git a/public/proxyValidate.php b/public/proxyValidate.php index 9349e0e2..01ab183d 100644 --- a/public/proxyValidate.php +++ b/public/proxyValidate.php @@ -26,6 +26,8 @@ * pgtUrl */ +declare(strict_types=1); + $method = 'proxyValidate'; require_once('utility/validateTicket.php'); diff --git a/public/samlValidate.php b/public/samlValidate.php index 5574b3d8..fdb50128 100644 --- a/public/samlValidate.php +++ b/public/samlValidate.php @@ -1,5 +1,7 @@ [ 'core:AdminPassword', diff --git a/tests/config/module_casserver.php b/tests/config/module_casserver.php index 9d1dc0f3..ee486276 100644 --- a/tests/config/module_casserver.php +++ b/tests/config/module_casserver.php @@ -5,6 +5,8 @@ * */ +declare(strict_types=1); + $config = [ 'authsource' => 'casserver', diff --git a/tests/public/LoginIntegrationTest.php b/tests/public/LoginIntegrationTest.php index 66e77e6d..5231753b 100644 --- a/tests/public/LoginIntegrationTest.php +++ b/tests/public/LoginIntegrationTest.php @@ -7,7 +7,6 @@ use DOMDocument; use PHPUnit\Framework\TestCase; use SimpleSAML\Configuration; -use SimpleSAML\Logger; use SimpleSAML\TestUtils\BuiltInServer; use SimpleSAML\XML\DOMDocumentFactory; diff --git a/tests/src/Ticket/DelegatingTicketStoreTest.php b/tests/src/Ticket/DelegatingTicketStoreTest.php index 893bf139..db6f7b98 100644 --- a/tests/src/Ticket/DelegatingTicketStoreTest.php +++ b/tests/src/Ticket/DelegatingTicketStoreTest.php @@ -63,7 +63,7 @@ public function setup(): void ); Configuration::setPreLoadedConfig($this->config, 'config.php'); - $this->ticketstoreConfig = array( + $this->ticketstoreConfig = [ 'delegateTo' => 'all', 'ticketStores' => [ 'name1' => [ @@ -82,7 +82,7 @@ public function setup(): void 'directory' => 'does-not-exist', ], ] - ); + ]; $this->fileStore1 = new FileSystemTicketStore( Configuration::loadFromArray(['ticketstore' => $this->ticketstoreConfig['ticketStores']['name1']]) @@ -176,14 +176,14 @@ public function testNamed(): void */ public function testDelegateErrorsIfNoSuccess(): void { - $config = array( + $config = [ 'delegateTo' => 'all', 'ticketStores' => [ 'error' => [ 'class' => ErroringTicketStore::class ] ] - ); + ]; $ticketStore = new DelegatingTicketStore(Configuration::loadFromArray(['ticketstore' => $config])); try {