diff --git a/lib/SimpleSAML/Auth/ProcessingChain.php b/lib/SimpleSAML/Auth/ProcessingChain.php index 35af723c2cae5f27d7cf0e5652ed133709e13fb3..4b3e9066d9a543417233130ea93ee7bb0f1e2e15 100644 --- a/lib/SimpleSAML/Auth/ProcessingChain.php +++ b/lib/SimpleSAML/Auth/ProcessingChain.php @@ -26,20 +26,20 @@ class ProcessingChain /** * The list of remaining filters which should be applied to the state. */ - const FILTERS_INDEX = '\SimpleSAML\Auth\ProcessingChain.filters'; + public const FILTERS_INDEX = '\SimpleSAML\Auth\ProcessingChain.filters'; /** * The stage we use for completed requests. */ - const COMPLETED_STAGE = '\SimpleSAML\Auth\ProcessingChain.completed'; + public const COMPLETED_STAGE = '\SimpleSAML\Auth\ProcessingChain.completed'; /** * The request parameter we will use to pass the state identifier when we redirect after * having completed processing of the state. */ - const AUTHPARAM = 'AuthProcId'; + public const AUTHPARAM = 'AuthProcId'; /** diff --git a/lib/SimpleSAML/Auth/State.php b/lib/SimpleSAML/Auth/State.php index 2a298356d0569a8595187a7308b122ef5451dea6..1da1b61ad7f9a5cb61f259e0729d575ca350d324 100644 --- a/lib/SimpleSAML/Auth/State.php +++ b/lib/SimpleSAML/Auth/State.php @@ -44,50 +44,50 @@ class State /** * The index in the state array which contains the identifier. */ - const ID = '\SimpleSAML\Auth\State.id'; + public const ID = '\SimpleSAML\Auth\State.id'; /** * The index in the cloned state array which contains the identifier of the * original state. */ - const CLONE_ORIGINAL_ID = '\SimpleSAML\Auth\State.cloneOriginalId'; + public const CLONE_ORIGINAL_ID = '\SimpleSAML\Auth\State.cloneOriginalId'; /** * The index in the state array which contains the current stage. */ - const STAGE = '\SimpleSAML\Auth\State.stage'; + public const STAGE = '\SimpleSAML\Auth\State.stage'; /** * The index in the state array which contains the restart URL. */ - const RESTART = '\SimpleSAML\Auth\State.restartURL'; + public const RESTART = '\SimpleSAML\Auth\State.restartURL'; /** * The index in the state array which contains the exception handler URL. */ - const EXCEPTION_HANDLER_URL = '\SimpleSAML\Auth\State.exceptionURL'; + public const EXCEPTION_HANDLER_URL = '\SimpleSAML\Auth\State.exceptionURL'; /** * The index in the state array which contains the exception handler function. */ - const EXCEPTION_HANDLER_FUNC = '\SimpleSAML\Auth\State.exceptionFunc'; + public const EXCEPTION_HANDLER_FUNC = '\SimpleSAML\Auth\State.exceptionFunc'; /** * The index in the state array which contains the exception data. */ - const EXCEPTION_DATA = '\SimpleSAML\Auth\State.exceptionData'; + public const EXCEPTION_DATA = '\SimpleSAML\Auth\State.exceptionData'; /** * The stage of a state with an exception. */ - const EXCEPTION_STAGE = '\SimpleSAML\Auth\State.exceptionStage'; + public const EXCEPTION_STAGE = '\SimpleSAML\Auth\State.exceptionStage'; /** @@ -95,7 +95,7 @@ class State * Note that this does not contain a "." since it's used in the * _REQUEST superglobal that does not allow dots. */ - const EXCEPTION_PARAM = '\SimpleSAML\Auth\State_exceptionId'; + public const EXCEPTION_PARAM = '\SimpleSAML\Auth\State_exceptionId'; /** diff --git a/lib/SimpleSAML/Error/CannotSetCookie.php b/lib/SimpleSAML/Error/CannotSetCookie.php index d3b0f9d537a49b6b0c49ae48546ea80fd568ae2c..3c4faa810bc19b9a3e91b986e378e5d09dd562b3 100644 --- a/lib/SimpleSAML/Error/CannotSetCookie.php +++ b/lib/SimpleSAML/Error/CannotSetCookie.php @@ -18,7 +18,7 @@ class CannotSetCookie extends Exception * * @var int */ - const UNKNOWN = 0; + public const UNKNOWN = 0; /** * The exception was due to the HTTP headers being already sent, and therefore we cannot send additional headers to @@ -26,12 +26,12 @@ class CannotSetCookie extends Exception * * @var int */ - const HEADERS_SENT = 1; + public const HEADERS_SENT = 1; /** * The exception was due to trying to set a secure cookie over an insecure channel. * * @var int */ - const SECURE_COOKIE = 2; + public const SECURE_COOKIE = 2; } diff --git a/lib/SimpleSAML/Kernel.php b/lib/SimpleSAML/Kernel.php index 03389ade5a8d059c83d68ef496824e277aeff701..f422eac0726e31b655139fb286d80f2c1540cfb2 100644 --- a/lib/SimpleSAML/Kernel.php +++ b/lib/SimpleSAML/Kernel.php @@ -22,7 +22,7 @@ class Kernel extends BaseKernel { use MicroKernelTrait; - const CONFIG_EXTS = '.{php,xml,yaml,yml}'; + public const CONFIG_EXTS = '.{php,xml,yaml,yml}'; /** * @var string diff --git a/lib/SimpleSAML/Locale/Localization.php b/lib/SimpleSAML/Locale/Localization.php index 3ce16dc13395aecec628a19653a14c729934d378..9b5d4383b0f0f69afaa9cc46da7bd791f22b0e2a 100644 --- a/lib/SimpleSAML/Locale/Localization.php +++ b/lib/SimpleSAML/Locale/Localization.php @@ -30,21 +30,21 @@ class Localization * * @var string */ - const DEFAULT_DOMAIN = 'messages'; + public const DEFAULT_DOMAIN = 'messages'; /** * Old internationalization backend included in SimpleSAMLphp. * * @var string */ - const SSP_I18N_BACKEND = 'SimpleSAMLphp'; + public const SSP_I18N_BACKEND = 'SimpleSAMLphp'; /** * An internationalization backend implemented purely in PHP. * * @var string */ - const GETTEXT_I18N_BACKEND = 'gettext/gettext'; + public const GETTEXT_I18N_BACKEND = 'gettext/gettext'; /** * The default locale directory diff --git a/lib/SimpleSAML/Logger.php b/lib/SimpleSAML/Logger.php index bf5fdc325b35e3d3d14e849479022b6203686a70..856f23fe52505159176a17411452eea67d53690f 100644 --- a/lib/SimpleSAML/Logger.php +++ b/lib/SimpleSAML/Logger.php @@ -73,7 +73,7 @@ class Logger * * @var string */ - const NO_TRACKID = '_NOTRACKIDYET_'; + public const NO_TRACKID = '_NOTRACKIDYET_'; /** * This variable holds the track ID we have retrieved from the session class. It can also be NULL, in which case @@ -128,28 +128,28 @@ class Logger private static $shuttingDown = false; /** @var int */ - const EMERG = 0; + public const EMERG = 0; /** @var int */ - const ALERT = 1; + public const ALERT = 1; /** @var int */ - const CRIT = 2; + public const CRIT = 2; /** @var int */ - const ERR = 3; + public const ERR = 3; /** @var int */ - const WARNING = 4; + public const WARNING = 4; /** @var int */ - const NOTICE = 5; + public const NOTICE = 5; /** @var int */ - const INFO = 6; + public const INFO = 6; /** @var int */ - const DEBUG = 7; + public const DEBUG = 7; /** diff --git a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php index c54e7c325c937a187ff231c35b85f819ec459adc..af80ea187c8dc76ef3b19119c9b3a7f6a88b2786 100644 --- a/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php +++ b/lib/SimpleSAML/Metadata/MetaDataStorageHandlerSerialize.php @@ -21,7 +21,7 @@ class MetaDataStorageHandlerSerialize extends MetaDataStorageSource * * @var string */ - const EXTENSION = '.serialized'; + public const EXTENSION = '.serialized'; /** diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php index 1a6f73adbacfebe41aacd8d00af2f8266a6a662f..61f85cce9f604fda773df48f7ef1615b0d4fcd09 100644 --- a/lib/SimpleSAML/Session.php +++ b/lib/SimpleSAML/Session.php @@ -32,7 +32,7 @@ class Session implements \Serializable, Utils\ClearableState * This is a timeout value for setData, which indicates that the data * should never be deleted, i.e. lasts the whole session lifetime. */ - const DATA_TIMEOUT_SESSION_END = 'sessionEndTimeout'; + public const DATA_TIMEOUT_SESSION_END = 'sessionEndTimeout'; /** * The list of loaded session objects. diff --git a/lib/SimpleSAML/Utils/Random.php b/lib/SimpleSAML/Utils/Random.php index 417e5a6dc09e1283645cd65039cacad5183cd3b8..495428d408d0c16aebbabfa2a379783808ea7b41 100644 --- a/lib/SimpleSAML/Utils/Random.php +++ b/lib/SimpleSAML/Utils/Random.php @@ -14,7 +14,7 @@ class Random /** * The fixed length of random identifiers. */ - const ID_LENGTH = 43; + public const ID_LENGTH = 43; /** * Generate a random identifier, ID_LENGTH bytes long. diff --git a/lib/SimpleSAML/Utils/System.php b/lib/SimpleSAML/Utils/System.php index 090af646fccad20279bc03a3d53e21532a1e24ab..374a56326f1cff9b2c5ff45d6d5e354823cce0dd 100644 --- a/lib/SimpleSAML/Utils/System.php +++ b/lib/SimpleSAML/Utils/System.php @@ -15,14 +15,14 @@ use SimpleSAML\Error; class System { - const WINDOWS = 1; - const LINUX = 2; - const OSX = 3; - const HPUX = 4; - const UNIX = 5; - const BSD = 6; - const IRIX = 7; - const SUNOS = 8; + public const WINDOWS = 1; + public const LINUX = 2; + public const OSX = 3; + public const HPUX = 4; + public const UNIX = 5; + public const BSD = 6; + public const IRIX = 7; + public const SUNOS = 8; /** diff --git a/modules/admin/lib/Controller/Config.php b/modules/admin/lib/Controller/Config.php index cb5325ebb610ed386b10ddeb305dbf1b8295b513..0886789729e68a08ad30bd882a923fc3ffac0262 100644 --- a/modules/admin/lib/Controller/Config.php +++ b/modules/admin/lib/Controller/Config.php @@ -22,9 +22,9 @@ use Symfony\Component\HttpFoundation\Request; */ class Config { - const LATEST_VERSION_STATE_KEY = 'core:latest_simplesamlphp_version'; + public const LATEST_VERSION_STATE_KEY = 'core:latest_simplesamlphp_version'; - const RELEASES_API = 'https://api.github.com/repos/simplesamlphp/simplesamlphp/releases/latest'; + public const RELEASES_API = 'https://api.github.com/repos/simplesamlphp/simplesamlphp/releases/latest'; /** @var \SimpleSAML\Configuration */ protected $config; diff --git a/modules/core/lib/Auth/UserPassBase.php b/modules/core/lib/Auth/UserPassBase.php index e29512533fb07b1f3cff7f7c447f986b65ea90d5..703bf6b78527b2791ef558942efe707245603760 100644 --- a/modules/core/lib/Auth/UserPassBase.php +++ b/modules/core/lib/Auth/UserPassBase.php @@ -26,12 +26,12 @@ abstract class UserPassBase extends \SimpleSAML\Auth\Source /** * The string used to identify our states. */ - const STAGEID = '\SimpleSAML\Module\core\Auth\UserPassBase.state'; + public const STAGEID = '\SimpleSAML\Module\core\Auth\UserPassBase.state'; /** * The key of the AuthId field in the state. */ - const AUTHID = '\SimpleSAML\Module\core\Auth\UserPassBase.AuthId'; + public const AUTHID = '\SimpleSAML\Module\core\Auth\UserPassBase.AuthId'; /** * Username we should force. diff --git a/modules/core/lib/Auth/UserPassOrgBase.php b/modules/core/lib/Auth/UserPassOrgBase.php index 426eeb102c034071dc99002943208f59551da562..3c2a51f9badd409963d984a14effe462e46ab480 100644 --- a/modules/core/lib/Auth/UserPassOrgBase.php +++ b/modules/core/lib/Auth/UserPassOrgBase.php @@ -26,20 +26,17 @@ abstract class UserPassOrgBase extends \SimpleSAML\Auth\Source /** * The string used to identify our states. */ - const STAGEID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.state'; - + public const STAGEID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.state'; /** * The key of the AuthId field in the state. */ - const AUTHID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.AuthId'; - + public const AUTHID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.AuthId'; /** * The key of the OrgId field in the state, identifies which org was selected. */ - const ORGID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.SelectedOrg'; - + public const ORGID = '\SimpleSAML\Module\core\Auth\UserPassOrgBase.SelectedOrg'; /** * What way do we handle the organization as part of the username. diff --git a/modules/exampleauth/lib/Auth/Source/External.php b/modules/exampleauth/lib/Auth/Source/External.php index 1f4e7bf20e4712f9620245c4695b9e4d85e7ec65..a3b72b437c59286e2df4e3ddb92c6b42b186f29b 100644 --- a/modules/exampleauth/lib/Auth/Source/External.php +++ b/modules/exampleauth/lib/Auth/Source/External.php @@ -34,7 +34,7 @@ class External extends \SimpleSAML\Auth\Source /** * The key of the AuthId field in the state. */ - const AUTHID = 'SimpleSAML\Module\exampleauth\Auth\Source\External.AuthId'; + public const AUTHID = 'SimpleSAML\Module\exampleauth\Auth\Source\External.AuthId'; /** diff --git a/modules/multiauth/lib/Auth/Source/MultiAuth.php b/modules/multiauth/lib/Auth/Source/MultiAuth.php index 6bc2cc0abc0c6eb15ee76bc5e7551bd6e956926c..be06955f2a2bd8e5740e0da92943dd7527685488 100644 --- a/modules/multiauth/lib/Auth/Source/MultiAuth.php +++ b/modules/multiauth/lib/Auth/Source/MultiAuth.php @@ -23,22 +23,22 @@ class MultiAuth extends \SimpleSAML\Auth\Source /** * The key of the AuthId field in the state. */ - const AUTHID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.AuthId'; + public const AUTHID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.AuthId'; /** * The string used to identify our states. */ - const STAGEID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.StageId'; + public const STAGEID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.StageId'; /** * The key where the sources is saved in the state. */ - const SOURCESID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.SourceId'; + public const SOURCESID = '\SimpleSAML\Module\multiauth\Auth\Source\MultiAuth.SourceId'; /** * The key where the selected source is saved in the session. */ - const SESSION_SOURCE = 'multiauth:selectedSource'; + public const SESSION_SOURCE = 'multiauth:selectedSource'; /** * Array of sources we let the user chooses among. diff --git a/modules/saml/lib/IdP/SQLNameID.php b/modules/saml/lib/IdP/SQLNameID.php index a3e400a6043eaad224db3855292b5ba06a8d823a..5c72d48be80199133ed25813139fc52dac260b7c 100644 --- a/modules/saml/lib/IdP/SQLNameID.php +++ b/modules/saml/lib/IdP/SQLNameID.php @@ -18,9 +18,9 @@ use SimpleSAML\Configuration; */ class SQLNameID { - const TABLE_VERSION = 1; - const DEFAULT_TABLE_PREFIX = ''; - const TABLE_SUFFIX = '_saml_PersistentNameID'; + public const TABLE_VERSION = 1; + public const DEFAULT_TABLE_PREFIX = ''; + public const TABLE_SUFFIX = '_saml_PersistentNameID'; /** diff --git a/tests/SigningTestCase.php b/tests/SigningTestCase.php index 75ff8c43df1f441c34f339e0276f3896a58f0cb4..a0fa6a67e6c5d70851167605ceab83eb007d0423 100644 --- a/tests/SigningTestCase.php +++ b/tests/SigningTestCase.php @@ -166,12 +166,12 @@ NOWDOC; /** @var \SimpleSAML\Configuration */ protected $config; - const ROOTDIRNAME = 'testdir'; - const DEFAULTCERTDIR = 'certdir'; - const CA_PRIVATE_KEY = 'ca.key.pem'; - const CA_CERTIFICATE = 'ca.cert.pem'; - const GOOD_PRIVATE_KEY = 'good.key.pem'; - const GOOD_CERTIFICATE = 'good.cert.pem'; + private const ROOTDIRNAME = 'testdir'; + private const DEFAULTCERTDIR = 'certdir'; + private const CA_PRIVATE_KEY = 'ca.key.pem'; + private const CA_CERTIFICATE = 'ca.cert.pem'; + private const GOOD_PRIVATE_KEY = 'good.key.pem'; + private const GOOD_CERTIFICATE = 'good.cert.pem'; /** diff --git a/tests/lib/SimpleSAML/Utils/CryptoTest.php b/tests/lib/SimpleSAML/Utils/CryptoTest.php index f0d28123b5606caa2cb588834c21cfd29ba869ee..8cd12bdc0ca24c73fcc252603dfbd8f4c9032049 100644 --- a/tests/lib/SimpleSAML/Utils/CryptoTest.php +++ b/tests/lib/SimpleSAML/Utils/CryptoTest.php @@ -14,9 +14,9 @@ use SimpleSAML\Utils\Crypto; */ class CryptoTest extends TestCase { - const ROOTDIRNAME = 'testdir'; + private const ROOTDIRNAME = 'testdir'; - const DEFAULTCERTDIR = 'certdir'; + private const DEFAULTCERTDIR = 'certdir'; /** @var \org\bovigo\vfs\vfsStreamDirectory */ protected $root; diff --git a/tests/lib/SimpleSAML/Utils/SystemTest.php b/tests/lib/SimpleSAML/Utils/SystemTest.php index bc42bda49e81ffc35941429fa44d8e33b7486086..ad1c44456487663b91a2e2da5ab3e20418860f9f 100644 --- a/tests/lib/SimpleSAML/Utils/SystemTest.php +++ b/tests/lib/SimpleSAML/Utils/SystemTest.php @@ -16,9 +16,9 @@ use SimpleSAML\Utils\System; */ class SystemTest extends TestCase { - const ROOTDIRNAME = 'testdir'; + private const ROOTDIRNAME = 'testdir'; - const DEFAULTTEMPDIR = 'tempdir'; + private const DEFAULTTEMPDIR = 'tempdir'; /** @var \org\bovigo\vfs\vfsStreamDirectory */ protected $root; diff --git a/tests/lib/SimpleSAML/Utils/XMLTest.php b/tests/lib/SimpleSAML/Utils/XMLTest.php index 7eb3a7919c13b895ca62da9dfda4ce4d8e88a3e6..f4446fb74fc060bd9e844e70b417e0d518742a3a 100644 --- a/tests/lib/SimpleSAML/Utils/XMLTest.php +++ b/tests/lib/SimpleSAML/Utils/XMLTest.php @@ -13,9 +13,7 @@ use SimpleSAML\Utils\XML; */ class XMLTest extends TestCase { - const FRAMEWORK = 'vendor/simplesamlphp/simplesamlphp-test-framework'; - // Visibility on constants is supported from PHP 7.1 and up - // private const FRAMEWORK = 'vendor/simplesamlphp/simplesamlphp-test-framework'; + private const FRAMEWORK = 'vendor/simplesamlphp/simplesamlphp-test-framework'; /** * @covers \SimpleSAML\Utils\XML::isDOMNodeOfType diff --git a/tests/lib/SimpleSAML/XML/ParserTest.php b/tests/lib/SimpleSAML/XML/ParserTest.php index ae5a978aef52dd170ac2600852fa395b284afe72..2c1767c2b14e7f56581c09e67059d4fa00fc9aa5 100644 --- a/tests/lib/SimpleSAML/XML/ParserTest.php +++ b/tests/lib/SimpleSAML/XML/ParserTest.php @@ -17,7 +17,7 @@ use SimpleSAML\XML\Parser; */ class ParserTest extends TestCase { - const XMLDOC = <<< XML + private const XMLDOC = <<< XML <?xml version="1.0" encoding="UTF-8"?> <Root> <Value>Hello, World!</Value> diff --git a/tests/lib/SimpleSAML/XML/SignerTest.php b/tests/lib/SimpleSAML/XML/SignerTest.php index a2d157659a8f7ced60645b1f3961308cbcb8d787..bf911b96efad7d66bc82f535a9e3ca31c8bc02bb 100644 --- a/tests/lib/SimpleSAML/XML/SignerTest.php +++ b/tests/lib/SimpleSAML/XML/SignerTest.php @@ -48,11 +48,11 @@ d2udRIYG0WcjQTk86+EraXNGtuwUaknQ7WPKlJwLzypuZM8lk3F1FXxXWomHN3SH -----END CERTIFICATE----- NOWDOC; - const ROOTDIRNAME = 'testdir'; + private const ROOTDIRNAME = 'testdir'; - const DEFAULTCERTDIR = 'certdir'; + private const DEFAULTCERTDIR = 'certdir'; - const OTHER_CERTIFICATE = 'other_certificate.pem'; + private const OTHER_CERTIFICATE = 'other_certificate.pem'; /**