Skip to content

Commit

Permalink
Upgrade coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Aug 24, 2024
1 parent 7ddde36 commit 9a5da2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"require-dev": {
"ext-xdebug": "*",
"aplus/coding-standard": "^2.0",
"aplus/coding-standard": "^2.8",
"ergebnis/composer-normalize": "^2.25",
"jetbrains/phpstorm-attributes": "^1.0",
"phpmd/phpmd": "^2.13",
Expand Down
12 changes: 6 additions & 6 deletions src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ abstract class Logger
* Active log level.
*/
protected LogLevel $level = LogLevel::DEBUG;
protected Log | null $lastLog = null;
protected ?Log $lastLog = null;
protected LogCollector $debugCollector;

/**
* Logger constructor.
*
* @param string $destination
* @param int|LogLevel $level
* @param LogLevel|int $level
* @param array<mixed> $config
*/
public function __construct(
string $destination,
LogLevel|int $level = LogLevel::DEBUG,
LogLevel | int $level = LogLevel::DEBUG,
array $config = []
) {
$this->setDestination($destination);
Expand Down Expand Up @@ -86,13 +86,13 @@ protected function getConfig() : array
/**
* Logs with an arbitrary level.
*
* @param int|LogLevel $level
* @param LogLevel|int $level
* @param string $message
* @param array<string> $context
*
* @return bool
*/
public function log(LogLevel|int $level, string $message, array $context = []) : bool
public function log(LogLevel | int $level, string $message, array $context = []) : bool
{
$debug = isset($this->debugCollector);
if ($debug) {
Expand Down Expand Up @@ -266,7 +266,7 @@ public function getLevel() : LogLevel
return $this->level;
}

public function setLevel(LogLevel|int $level) : static
public function setLevel(LogLevel | int $level) : static
{
if (\is_int($level)) {
$level = LogLevel::from($level);
Expand Down

0 comments on commit 9a5da2c

Please sign in to comment.