mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 09:06:10 +02:00
Add scalar types to processor/formatters and top level classes
This commit is contained in:
@@ -20,7 +20,7 @@ class UidProcessor
|
||||
{
|
||||
private $uid;
|
||||
|
||||
public function __construct($length = 7)
|
||||
public function __construct(int $length = 7)
|
||||
{
|
||||
if (!is_int($length) || $length > 32 || $length < 1) {
|
||||
throw new \InvalidArgumentException('The uid length must be an integer between 1 and 32');
|
||||
@@ -29,7 +29,7 @@ class UidProcessor
|
||||
$this->uid = substr(hash('md5', uniqid('', true)), 0, $length);
|
||||
}
|
||||
|
||||
public function __invoke(array $record)
|
||||
public function __invoke(array $record): array
|
||||
{
|
||||
$record['extra']['uid'] = $this->uid;
|
||||
|
||||
@@ -39,7 +39,7 @@ class UidProcessor
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUid()
|
||||
public function getUid(): string
|
||||
{
|
||||
return $this->uid;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user