N°5809 Update apereo/phpcas from 1.6.0 to 1.6.1

This commit is contained in:
Pierre Goiffon
2024-01-25 15:00:09 +01:00
parent 7a5ce8cd6b
commit 71d9710322
25 changed files with 141 additions and 326 deletions

35
composer.lock generated
View File

@@ -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",

View File

@@ -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

View File

@@ -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

View File

@@ -1,7 +0,0 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

View File

@@ -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

View File

@@ -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/"
}

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="source/CAS.php" convertNoticesToExceptions="false" colors="true" stderr="true" backupGlobals="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="false">
<include>
<directory>source/</directory>
</include>
</coverage>
<testsuites>
<testsuite name="phpCAS Tests">
<directory>test/CAS/Tests/</directory>
</testsuite>
</testsuites>
</phpunit>

View File

@@ -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

View File

@@ -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.
*

View File

@@ -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',

View File

@@ -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',
);

View File

@@ -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'),

View File

@@ -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',

View File

@@ -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"
},

View File

@@ -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(),

View File

@@ -1,128 +0,0 @@
<?php
namespace Psr\Log;
/**
* This is a simple Logger implementation that other Loggers can inherit from.
*
* It simply delegates all log-level-specific methods to the `log` method to
* reduce boilerplate code that a simple Logger that does the same thing with
* messages regardless of the error level has to implement.
*/
abstract class AbstractLogger implements LoggerInterface
{
/**
* System is unusable.
*
* @param string $message
* @param mixed[] $context
*
* @return void
*/
public function emergency($message, array $context = array())
{
$this->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);
}
}

View File

@@ -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"
}
}
}

View File

@@ -0,0 +1,15 @@
<?php
namespace Psr\Log;
/**
* This is a simple Logger implementation that other Loggers can inherit from.
*
* It simply delegates all log-level-specific methods to the `log` method to
* reduce boilerplate code that a simple Logger that does the same thing with
* messages regardless of the error level has to implement.
*/
abstract class AbstractLogger implements LoggerInterface
{
use LoggerTrait;
}

View File

@@ -14,5 +14,5 @@ interface LoggerAwareInterface
*
* @return void
*/
public function setLogger(LoggerInterface $logger);
public function setLogger(LoggerInterface $logger): void;
}

View File

@@ -12,14 +12,14 @@ trait LoggerAwareTrait
*
* @var LoggerInterface|null
*/
protected $logger;
protected ?LoggerInterface $logger = null;
/**
* Sets a logger.
*
* @param LoggerInterface $logger
*/
public function setLogger(LoggerInterface $logger)
public function setLogger(LoggerInterface $logger): void
{
$this->logger = $logger;
}

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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
}