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 15, 2024
1 parent 845d5b7 commit c3b6334
Show file tree
Hide file tree
Showing 19 changed files with 36 additions and 22 deletions.
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
By default it is less stringent about long lines than other coding standards
</description>

<file>config-templates</file>
<file>config</file>
<file>public</file>
<file>src</file>
<file>templates</file>
Expand Down
2 changes: 2 additions & 0 deletions public/cas.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
*
*/

declare(strict_types=1);

$validFunctions = [
'login' => 'login',
'validate' => 'validate',
Expand Down
2 changes: 2 additions & 0 deletions public/loggedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*
*/

declare(strict_types=1);

session_cache_limiter('nocache');

$globalConfig = \SimpleSAML\Configuration::getInstance();
Expand Down
2 changes: 2 additions & 0 deletions public/loggedOut.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
*
*/

declare(strict_types=1);

session_cache_limiter('nocache');

$globalConfig = \SimpleSAML\Configuration::getInstance();
Expand Down
10 changes: 5 additions & 5 deletions public/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions public/logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 2 additions & 0 deletions public/proxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
*
*/

declare(strict_types=1);

require_once('utility/urlUtils.php');

$casconfig = \SimpleSAML\Configuration::getConfig('module_casserver.php');
Expand Down
2 changes: 2 additions & 0 deletions public/proxyValidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* pgtUrl
*/

declare(strict_types=1);

$method = 'proxyValidate';

require_once('utility/validateTicket.php');
2 changes: 2 additions & 0 deletions public/samlValidate.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

use SimpleSAML\Logger;
use SimpleSAML\Module\casserver\Cas\Protocol\SamlValidateResponder;

Expand Down
2 changes: 2 additions & 0 deletions public/serviceValidate.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* pgtUrl
*/

declare(strict_types=1);

$method = 'serviceValidate';

require_once('utility/validateTicket.php');
3 changes: 0 additions & 3 deletions public/utility/validateTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
use SimpleSAML\Configuration;
use SimpleSAML\Logger;
use SimpleSAML\Module;
use SimpleSAML\Module\casserver\Cas\Protocol\Cas20;
use SimpleSAML\Module\casserver\Cas\Ticket\TicketFactory;
use SimpleSAML\Module\casserver\Cas\Ticket\TicketStore;
use SimpleSAML\Utils;
use SimpleSAML\XML\CAS\Constants as C;

Expand Down
2 changes: 2 additions & 0 deletions public/validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
*
*/

declare(strict_types=1);

require_once('utility/urlUtils.php');

/* Load simpleSAMLphp, configuration and metadata */
Expand Down
4 changes: 0 additions & 4 deletions src/Cas/Protocol/Cas20.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@

namespace SimpleSAML\Module\casserver\Cas\Protocol;

use DOMDocument;
use DOMElement;
use DOMException;
use SimpleSAML\CAS\XML\cas\Attributes;
use SimpleSAML\CAS\XML\cas\AuthenticationDate;
use SimpleSAML\CAS\XML\cas\AuthenticationFailure;
Expand All @@ -51,7 +48,6 @@
use function filter_var;
use function is_null;
use function is_string;
use function strval;
use function str_replace;

class Cas20
Expand Down
1 change: 0 additions & 1 deletion src/Cas/TicketValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use InvalidArgumentException;
use SimpleSAML\Configuration;
use SimpleSAML\Error\BadRequest;
use SimpleSAML\Logger;
use SimpleSAML\Module;
use SimpleSAML\Module\casserver\Cas\CasException;
Expand Down
2 changes: 2 additions & 0 deletions tests/config/authsources.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

$config = [
'admin' => [
'core:AdminPassword',
Expand Down
2 changes: 2 additions & 0 deletions tests/config/module_casserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
*
*/

declare(strict_types=1);

$config = [
'authsource' => 'casserver',

Expand Down
1 change: 0 additions & 1 deletion tests/public/LoginIntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use DOMDocument;
use PHPUnit\Framework\TestCase;
use SimpleSAML\Configuration;
use SimpleSAML\Logger;
use SimpleSAML\TestUtils\BuiltInServer;
use SimpleSAML\XML\DOMDocumentFactory;

Expand Down
8 changes: 4 additions & 4 deletions tests/src/Ticket/DelegatingTicketStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function setup(): void
);
Configuration::setPreLoadedConfig($this->config, 'config.php');

$this->ticketstoreConfig = array(
$this->ticketstoreConfig = [
'delegateTo' => 'all',
'ticketStores' => [
'name1' => [
Expand All @@ -82,7 +82,7 @@ public function setup(): void
'directory' => 'does-not-exist',
],
]
);
];

$this->fileStore1 = new FileSystemTicketStore(
Configuration::loadFromArray(['ticketstore' => $this->ticketstoreConfig['ticketStores']['name1']])
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit c3b6334

Please sign in to comment.