Upgrade to 3.8.0

This commit is contained in:
Bastian Allgeier
2022-10-06 10:11:54 +02:00
parent a9ed4e45ca
commit 7d168aae58
332 changed files with 26337 additions and 21977 deletions

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
}