diff --git a/composer.lock b/composer.lock index cd9de9409..2d9619b03 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "66fa7e8ca2e7c4e08e975ea5082c0673", + "content-hash": "94563890c76234c2ab5991c827b65781", "packages": [ { "name": "apereo/phpcas", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/apereo/phpCAS.git", - "reference": "f817c72a961484afef95ac64a9257c8e31f063b9" + "reference": "c129708154852656aabb13d8606cd5b12dbbabac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apereo/phpCAS/zipball/f817c72a961484afef95ac64a9257c8e31f063b9", - "reference": "f817c72a961484afef95ac64a9257c8e31f063b9", + "url": "https://api.github.com/repos/apereo/phpCAS/zipball/c129708154852656aabb13d8606cd5b12dbbabac", + "reference": "c129708154852656aabb13d8606cd5b12dbbabac", "shasum": "" }, "require": { @@ -38,6 +38,9 @@ } }, "autoload": { + "files": [ + "source/CAS.php" + ], "classmap": [ "source/" ] @@ -70,9 +73,9 @@ ], "support": { "issues": "https://github.com/apereo/phpCAS/issues", - "source": "https://github.com/apereo/phpCAS/tree/1.6.0" + "source": "https://github.com/apereo/phpCAS/tree/1.6.1" }, - "time": "2022-10-31T20:39:27+00:00" + "time": "2023-02-19T19:52:35+00:00" }, { "name": "combodo/tcpdf", @@ -1830,30 +1833,30 @@ }, { "name": "psr/log", - "version": "1.1.4", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1874,9 +1877,9 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, - "time": "2021-05-03T11:20:27+00:00" + "time": "2021-07-14T16:46:02+00:00" }, { "name": "ralouphie/getallheaders", diff --git a/lib/apereo/phpcas/.codecov.yml b/lib/apereo/phpcas/.codecov.yml deleted file mode 100644 index ddfdd0eff..000000000 --- a/lib/apereo/phpcas/.codecov.yml +++ /dev/null @@ -1,17 +0,0 @@ -codecov: - strict_yaml_branch: master - -coverage: - round: up - precision: 2 - status: - project: - default: - target: "70%" - informational: true - patch: # temporarily disabled - default: - target: "70%" - informational: true - -comment: false diff --git a/lib/apereo/phpcas/.gitattributes b/lib/apereo/phpcas/.gitattributes deleted file mode 100644 index 3e28f4e42..000000000 --- a/lib/apereo/phpcas/.gitattributes +++ /dev/null @@ -1,7 +0,0 @@ -/docs/ export-ignore -/test/ export-ignore -/utils/ export-ignore -/.buildpath export-ignore -/.gitignore export-ignore -/.project export-ignore -/.travis.yml export-ignore diff --git a/lib/apereo/phpcas/.github/dependabot.yml b/lib/apereo/phpcas/.github/dependabot.yml deleted file mode 100644 index c630ffa6b..000000000 --- a/lib/apereo/phpcas/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -version: 2 -updates: -- package-ecosystem: composer - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 diff --git a/lib/apereo/phpcas/.github/workflows/test.yml b/lib/apereo/phpcas/.github/workflows/test.yml deleted file mode 100644 index 081e334d6..000000000 --- a/lib/apereo/phpcas/.github/workflows/test.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Test - -on: - - push - - pull_request - -jobs: - test: - runs-on: ubuntu-latest - - strategy: - fail-fast: false - matrix: - php-version: - - php: '7.2' - phpunit: '8' - - php: '7.3' - phpunit: latest - - php: '7.4' - phpunit: latest - - php: '8.0' - phpunit: latest - - php: '8.1' - phpunit: latest - steps: - - uses: actions/checkout@v2 - - uses: php-actions/composer@v6 - with: - php_version: "${{ matrix.php-version.php }}" - - name: Run PHPUnit - uses: php-actions/phpunit@v3 - with: - version: "${{ matrix.php-version.phpunit }}" - php_version: "${{ matrix.php-version.php }}" - php_extensions: xdebug - args: --verbose --coverage-clover=coverage.xml - bootstrap: vendor/autoload.php - env: - XDEBUG_MODE: coverage - - name: Report coverage - uses: codecov/codecov-action@v1 - with: - files: coverage.xml diff --git a/lib/apereo/phpcas/composer.json b/lib/apereo/phpcas/composer.json index 89ab7b9f6..bf8a17c49 100644 --- a/lib/apereo/phpcas/composer.json +++ b/lib/apereo/phpcas/composer.json @@ -33,12 +33,12 @@ "phpstan/phpstan" : "^1.5" }, "autoload" : { + "files": ["source/CAS.php"], "classmap" : [ "source/" ] }, "autoload-dev" : { - "files": ["source/CAS.php"], "psr-4" : { "PhpCas\\" : "test/CAS/" } diff --git a/lib/apereo/phpcas/phpunit.xml.dist b/lib/apereo/phpcas/phpunit.xml.dist deleted file mode 100644 index f0431f153..000000000 --- a/lib/apereo/phpcas/phpunit.xml.dist +++ /dev/null @@ -1,13 +0,0 @@ - - - - - source/ - - - - - test/CAS/Tests/ - - - diff --git a/lib/apereo/phpcas/source/CAS.php b/lib/apereo/phpcas/source/CAS.php index 8243a83e3..71c04755a 100644 --- a/lib/apereo/phpcas/source/CAS.php +++ b/lib/apereo/phpcas/source/CAS.php @@ -57,7 +57,7 @@ if (!isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME']) && isset($ /** * phpCAS version. accessible for the user by phpCAS::getVersion(). */ -define('PHPCAS_VERSION', '1.6.0'); +define('PHPCAS_VERSION', '1.6.1'); /** * @addtogroup public diff --git a/lib/apereo/phpcas/source/CAS/Client.php b/lib/apereo/phpcas/source/CAS/Client.php index 91642ee52..8ca9711f4 100644 --- a/lib/apereo/phpcas/source/CAS/Client.php +++ b/lib/apereo/phpcas/source/CAS/Client.php @@ -973,11 +973,6 @@ class CAS_Client session_start(); phpCAS :: trace("Starting a new session " . session_id()); } - // init phpCAS session array - if (!isset($_SESSION[static::PHPCAS_SESSION_PREFIX]) - || !is_array($_SESSION[static::PHPCAS_SESSION_PREFIX])) { - $_SESSION[static::PHPCAS_SESSION_PREFIX] = array(); - } } // Only for debug purposes @@ -1198,9 +1193,21 @@ class CAS_Client { $this->validateSession($key); + $this->ensureSessionArray(); $_SESSION[static::PHPCAS_SESSION_PREFIX][$key] = $value; } + /** + * Ensure that the session array is initialized before writing to it. + */ + protected function ensureSessionArray() { + // init phpCAS session array + if (!isset($_SESSION[static::PHPCAS_SESSION_PREFIX]) + || !is_array($_SESSION[static::PHPCAS_SESSION_PREFIX])) { + $_SESSION[static::PHPCAS_SESSION_PREFIX] = array(); + } + } + /** * Remove a session value with the given key. * diff --git a/lib/composer/autoload_classmap.php b/lib/composer/autoload_classmap.php index 0dca0bdcb..68898b801 100644 --- a/lib/composer/autoload_classmap.php +++ b/lib/composer/autoload_classmap.php @@ -1453,14 +1453,14 @@ return array( 'Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php', 'Psr\\Http\\Message\\UriFactoryInterface' => $vendorDir . '/psr/http-factory/src/UriFactoryInterface.php', 'Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php', - 'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/Psr/Log/AbstractLogger.php', - 'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/Psr/Log/InvalidArgumentException.php', - 'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php', - 'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareInterface.php', - 'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerAwareTrait.php', - 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/Psr/Log/LoggerInterface.php', - 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/Psr/Log/LoggerTrait.php', - 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/Psr/Log/NullLogger.php', + 'Psr\\Log\\AbstractLogger' => $vendorDir . '/psr/log/src/AbstractLogger.php', + 'Psr\\Log\\InvalidArgumentException' => $vendorDir . '/psr/log/src/InvalidArgumentException.php', + 'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/src/LogLevel.php', + 'Psr\\Log\\LoggerAwareInterface' => $vendorDir . '/psr/log/src/LoggerAwareInterface.php', + 'Psr\\Log\\LoggerAwareTrait' => $vendorDir . '/psr/log/src/LoggerAwareTrait.php', + 'Psr\\Log\\LoggerInterface' => $vendorDir . '/psr/log/src/LoggerInterface.php', + 'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/src/LoggerTrait.php', + 'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/src/NullLogger.php', 'QRcode' => $vendorDir . '/combodo/tcpdf/include/barcodes/qrcode.php', 'Query' => $baseDir . '/application/query.class.inc.php', 'QueryBuilderContext' => $baseDir . '/core/querybuildercontext.class.inc.php', diff --git a/lib/composer/autoload_files.php b/lib/composer/autoload_files.php index 13191eb80..4124e1e53 100644 --- a/lib/composer/autoload_files.php +++ b/lib/composer/autoload_files.php @@ -20,5 +20,6 @@ return array( '25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', + '344f11dc3484aaed5cbde58e23513be4' => $vendorDir . '/apereo/phpcas/source/CAS.php', '6997bc0ca52a383ea79e2a4a84bb1f3e' => $baseDir . '/sources/alias.php', ); diff --git a/lib/composer/autoload_psr4.php b/lib/composer/autoload_psr4.php index e69498973..37e965ba4 100644 --- a/lib/composer/autoload_psr4.php +++ b/lib/composer/autoload_psr4.php @@ -48,7 +48,7 @@ return array( 'Symfony\\Bridge\\Twig\\' => array($vendorDir . '/symfony/twig-bridge'), 'ScssPhp\\ScssPhp\\' => array($vendorDir . '/scssphp/scssphp/src'), 'Sabberworm\\CSS\\' => array($vendorDir . '/sabberworm/php-css-parser/src'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/src'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), 'Psr\\EventDispatcher\\' => array($vendorDir . '/psr/event-dispatcher/src'), diff --git a/lib/composer/autoload_static.php b/lib/composer/autoload_static.php index 3efdad7fb..46cf3e858 100644 --- a/lib/composer/autoload_static.php +++ b/lib/composer/autoload_static.php @@ -21,6 +21,7 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f '25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php', 'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', + '344f11dc3484aaed5cbde58e23513be4' => __DIR__ . '/..' . '/apereo/phpcas/source/CAS.php', '6997bc0ca52a383ea79e2a4a84bb1f3e' => __DIR__ . '/../..' . '/sources/alias.php', ); @@ -280,7 +281,7 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f ), 'Psr\\Log\\' => array ( - 0 => __DIR__ . '/..' . '/psr/log/Psr/Log', + 0 => __DIR__ . '/..' . '/psr/log/src', ), 'Psr\\Http\\Message\\' => array ( @@ -1827,14 +1828,14 @@ class ComposerStaticInit7f81b4a2a468a061c306af5e447a9a9f 'Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php', 'Psr\\Http\\Message\\UriFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UriFactoryInterface.php', 'Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php', - 'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/AbstractLogger.php', - 'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/Psr/Log/InvalidArgumentException.php', - 'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/Psr/Log/LogLevel.php', - 'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareInterface.php', - 'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerAwareTrait.php', - 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerInterface.php', - 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/Psr/Log/LoggerTrait.php', - 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/Psr/Log/NullLogger.php', + 'Psr\\Log\\AbstractLogger' => __DIR__ . '/..' . '/psr/log/src/AbstractLogger.php', + 'Psr\\Log\\InvalidArgumentException' => __DIR__ . '/..' . '/psr/log/src/InvalidArgumentException.php', + 'Psr\\Log\\LogLevel' => __DIR__ . '/..' . '/psr/log/src/LogLevel.php', + 'Psr\\Log\\LoggerAwareInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareInterface.php', + 'Psr\\Log\\LoggerAwareTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerAwareTrait.php', + 'Psr\\Log\\LoggerInterface' => __DIR__ . '/..' . '/psr/log/src/LoggerInterface.php', + 'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerTrait.php', + 'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/src/NullLogger.php', 'QRcode' => __DIR__ . '/..' . '/combodo/tcpdf/include/barcodes/qrcode.php', 'Query' => __DIR__ . '/../..' . '/application/query.class.inc.php', 'QueryBuilderContext' => __DIR__ . '/../..' . '/core/querybuildercontext.class.inc.php', diff --git a/lib/composer/installed.json b/lib/composer/installed.json index 4acaa78fb..36ad3efc8 100644 --- a/lib/composer/installed.json +++ b/lib/composer/installed.json @@ -2,17 +2,17 @@ "packages": [ { "name": "apereo/phpcas", - "version": "1.6.0", - "version_normalized": "1.6.0.0", + "version": "1.6.1", + "version_normalized": "1.6.1.0", "source": { "type": "git", "url": "https://github.com/apereo/phpCAS.git", - "reference": "f817c72a961484afef95ac64a9257c8e31f063b9" + "reference": "c129708154852656aabb13d8606cd5b12dbbabac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/apereo/phpCAS/zipball/f817c72a961484afef95ac64a9257c8e31f063b9", - "reference": "f817c72a961484afef95ac64a9257c8e31f063b9", + "url": "https://api.github.com/repos/apereo/phpCAS/zipball/c129708154852656aabb13d8606cd5b12dbbabac", + "reference": "c129708154852656aabb13d8606cd5b12dbbabac", "shasum": "" }, "require": { @@ -26,7 +26,7 @@ "phpstan/phpstan": "^1.5", "phpunit/phpunit": ">=7.5" }, - "time": "2022-10-31T20:39:27+00:00", + "time": "2023-02-19T19:52:35+00:00", "type": "library", "extra": { "branch-alias": { @@ -35,6 +35,9 @@ }, "installation-source": "dist", "autoload": { + "files": [ + "source/CAS.php" + ], "classmap": [ "source/" ] @@ -67,7 +70,7 @@ ], "support": { "issues": "https://github.com/apereo/phpCAS/issues", - "source": "https://github.com/apereo/phpCAS/tree/1.6.0" + "source": "https://github.com/apereo/phpCAS/tree/1.6.1" }, "install-path": "../apereo/phpcas" }, @@ -1905,33 +1908,33 @@ }, { "name": "psr/log", - "version": "1.1.4", - "version_normalized": "1.1.4.0", + "version": "3.0.0", + "version_normalized": "3.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", + "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, - "time": "2021-05-03T11:20:27+00:00", + "time": "2021-07-14T16:46:02+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1952,7 +1955,7 @@ "psr-3" ], "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" + "source": "https://github.com/php-fig/log/tree/3.0.0" }, "install-path": "../psr/log" }, diff --git a/lib/composer/installed.php b/lib/composer/installed.php index f7cfc9186..8fdc1b165 100644 --- a/lib/composer/installed.php +++ b/lib/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'combodo/itop', 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '02b3e7b6212c01722fdc90b2f636aef42af9a62b', + 'reference' => '8eca2000238b2fbac7057654f08da00dd1b8eb88', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -11,9 +11,9 @@ ), 'versions' => array( 'apereo/phpcas' => array( - 'pretty_version' => '1.6.0', - 'version' => '1.6.0.0', - 'reference' => 'f817c72a961484afef95ac64a9257c8e31f063b9', + 'pretty_version' => '1.6.1', + 'version' => '1.6.1.0', + 'reference' => 'c129708154852656aabb13d8606cd5b12dbbabac', 'type' => 'library', 'install_path' => __DIR__ . '/../apereo/phpcas', 'aliases' => array(), @@ -22,7 +22,7 @@ 'combodo/itop' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '02b3e7b6212c01722fdc90b2f636aef42af9a62b', + 'reference' => '8eca2000238b2fbac7057654f08da00dd1b8eb88', 'type' => 'project', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -306,9 +306,9 @@ ), ), 'psr/log' => array( - 'pretty_version' => '1.1.4', - 'version' => '1.1.4.0', - 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', + 'pretty_version' => '3.0.0', + 'version' => '3.0.0.0', + 'reference' => 'fe5ea303b0887d5caefd3d431c3e61ad47037001', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/log', 'aliases' => array(), diff --git a/lib/psr/log/Psr/Log/AbstractLogger.php b/lib/psr/log/Psr/Log/AbstractLogger.php deleted file mode 100644 index e02f9daf3..000000000 --- a/lib/psr/log/Psr/Log/AbstractLogger.php +++ /dev/null @@ -1,128 +0,0 @@ -log(LogLevel::EMERGENCY, $message, $context); - } - - /** - * Action must be taken immediately. - * - * Example: Entire website down, database unavailable, etc. This should - * trigger the SMS alerts and wake you up. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function alert($message, array $context = array()) - { - $this->log(LogLevel::ALERT, $message, $context); - } - - /** - * Critical conditions. - * - * Example: Application component unavailable, unexpected exception. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function critical($message, array $context = array()) - { - $this->log(LogLevel::CRITICAL, $message, $context); - } - - /** - * Runtime errors that do not require immediate action but should typically - * be logged and monitored. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function error($message, array $context = array()) - { - $this->log(LogLevel::ERROR, $message, $context); - } - - /** - * Exceptional occurrences that are not errors. - * - * Example: Use of deprecated APIs, poor use of an API, undesirable things - * that are not necessarily wrong. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function warning($message, array $context = array()) - { - $this->log(LogLevel::WARNING, $message, $context); - } - - /** - * Normal but significant events. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function notice($message, array $context = array()) - { - $this->log(LogLevel::NOTICE, $message, $context); - } - - /** - * Interesting events. - * - * Example: User logs in, SQL logs. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function info($message, array $context = array()) - { - $this->log(LogLevel::INFO, $message, $context); - } - - /** - * Detailed debug information. - * - * @param string $message - * @param mixed[] $context - * - * @return void - */ - public function debug($message, array $context = array()) - { - $this->log(LogLevel::DEBUG, $message, $context); - } -} diff --git a/lib/psr/log/composer.json b/lib/psr/log/composer.json index ca0569537..879fc6f53 100644 --- a/lib/psr/log/composer.json +++ b/lib/psr/log/composer.json @@ -11,16 +11,16 @@ } ], "require": { - "php": ">=5.3.0" + "php": ">=8.0.0" }, "autoload": { "psr-4": { - "Psr\\Log\\": "Psr/Log/" + "Psr\\Log\\": "src" } }, "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "3.x-dev" } } } diff --git a/lib/psr/log/src/AbstractLogger.php b/lib/psr/log/src/AbstractLogger.php new file mode 100644 index 000000000..d60a091af --- /dev/null +++ b/lib/psr/log/src/AbstractLogger.php @@ -0,0 +1,15 @@ +logger = $logger; } diff --git a/lib/psr/log/Psr/Log/LoggerInterface.php b/lib/psr/log/src/LoggerInterface.php similarity index 66% rename from lib/psr/log/Psr/Log/LoggerInterface.php rename to lib/psr/log/src/LoggerInterface.php index 2206cfde4..b3a24b5f7 100644 --- a/lib/psr/log/Psr/Log/LoggerInterface.php +++ b/lib/psr/log/src/LoggerInterface.php @@ -22,12 +22,12 @@ interface LoggerInterface /** * System is unusable. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function emergency($message, array $context = array()); + public function emergency(string|\Stringable $message, array $context = []): void; /** * Action must be taken immediately. @@ -35,35 +35,35 @@ interface LoggerInterface * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function alert($message, array $context = array()); + public function alert(string|\Stringable $message, array $context = []): void; /** * Critical conditions. * * Example: Application component unavailable, unexpected exception. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function critical($message, array $context = array()); + public function critical(string|\Stringable $message, array $context = []): void; /** * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function error($message, array $context = array()); + public function error(string|\Stringable $message, array $context = []): void; /** * Exceptional occurrences that are not errors. @@ -71,55 +71,55 @@ interface LoggerInterface * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function warning($message, array $context = array()); + public function warning(string|\Stringable $message, array $context = []): void; /** * Normal but significant events. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function notice($message, array $context = array()); + public function notice(string|\Stringable $message, array $context = []): void; /** * Interesting events. * * Example: User logs in, SQL logs. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function info($message, array $context = array()); + public function info(string|\Stringable $message, array $context = []): void; /** * Detailed debug information. * - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void */ - public function debug($message, array $context = array()); + public function debug(string|\Stringable $message, array $context = []): void; /** * Logs with an arbitrary level. * * @param mixed $level - * @param string $message + * @param string|\Stringable $message * @param mixed[] $context * * @return void * * @throws \Psr\Log\InvalidArgumentException */ - public function log($level, $message, array $context = array()); + public function log($level, string|\Stringable $message, array $context = []): void; } diff --git a/lib/psr/log/Psr/Log/LoggerTrait.php b/lib/psr/log/src/LoggerTrait.php similarity index 69% rename from lib/psr/log/Psr/Log/LoggerTrait.php rename to lib/psr/log/src/LoggerTrait.php index e392fef0a..9c8733f95 100644 --- a/lib/psr/log/Psr/Log/LoggerTrait.php +++ b/lib/psr/log/src/LoggerTrait.php @@ -15,12 +15,12 @@ trait LoggerTrait /** * System is unusable. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function emergency($message, array $context = array()) + public function emergency(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::EMERGENCY, $message, $context); } @@ -31,12 +31,12 @@ trait LoggerTrait * Example: Entire website down, database unavailable, etc. This should * trigger the SMS alerts and wake you up. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function alert($message, array $context = array()) + public function alert(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::ALERT, $message, $context); } @@ -46,12 +46,12 @@ trait LoggerTrait * * Example: Application component unavailable, unexpected exception. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function critical($message, array $context = array()) + public function critical(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::CRITICAL, $message, $context); } @@ -60,12 +60,12 @@ trait LoggerTrait * Runtime errors that do not require immediate action but should typically * be logged and monitored. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function error($message, array $context = array()) + public function error(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::ERROR, $message, $context); } @@ -76,12 +76,12 @@ trait LoggerTrait * Example: Use of deprecated APIs, poor use of an API, undesirable things * that are not necessarily wrong. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function warning($message, array $context = array()) + public function warning(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::WARNING, $message, $context); } @@ -89,12 +89,12 @@ trait LoggerTrait /** * Normal but significant events. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function notice($message, array $context = array()) + public function notice(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::NOTICE, $message, $context); } @@ -104,12 +104,12 @@ trait LoggerTrait * * Example: User logs in, SQL logs. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function info($message, array $context = array()) + public function info(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::INFO, $message, $context); } @@ -117,12 +117,12 @@ trait LoggerTrait /** * Detailed debug information. * - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void */ - public function debug($message, array $context = array()) + public function debug(string|\Stringable $message, array $context = []): void { $this->log(LogLevel::DEBUG, $message, $context); } @@ -131,12 +131,12 @@ trait LoggerTrait * Logs with an arbitrary level. * * @param mixed $level - * @param string $message + * @param string|\Stringable $message * @param array $context * * @return void * * @throws \Psr\Log\InvalidArgumentException */ - abstract public function log($level, $message, array $context = array()); + abstract public function log($level, string|\Stringable $message, array $context = []): void; } diff --git a/lib/psr/log/Psr/Log/NullLogger.php b/lib/psr/log/src/NullLogger.php similarity index 78% rename from lib/psr/log/Psr/Log/NullLogger.php rename to lib/psr/log/src/NullLogger.php index c8f7293b1..c1cc3c069 100644 --- a/lib/psr/log/Psr/Log/NullLogger.php +++ b/lib/psr/log/src/NullLogger.php @@ -16,14 +16,14 @@ class NullLogger extends AbstractLogger * Logs with an arbitrary level. * * @param mixed $level - * @param string $message - * @param array $context + * @param string|\Stringable $message + * @param array $context * * @return void * * @throws \Psr\Log\InvalidArgumentException */ - public function log($level, $message, array $context = array()) + public function log($level, string|\Stringable $message, array $context = []): void { // noop }