Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow psr/log:^2 and psr/log:^3 installation #88

Merged
merged 4 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"psr/http-message": "^1.0",
"psr/http-message-implementation": "^1.0",
"psr/http-server-handler": "^1.0",
"psr/log": "^1.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"symfony/console": "^5.0 || ^6.0",
"webmozart/assert": "^1.9"
},
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions src/Log/Psr3AccessLogDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,71 +61,71 @@ public function logAccessForPsr7Resource(Request $request, ResponseInterface $re
/**
* {@inheritDoc}
*/
public function emergency($message, array $context = [])
public function emergency($message, array $context = []): void
{
$this->logger->emergency($message, $context);
}

/**
* {@inheritDoc}
*/
public function alert($message, array $context = [])
public function alert($message, array $context = []): void
{
$this->logger->alert($message, $context);
}

/**
* {@inheritDoc}
*/
public function critical($message, array $context = [])
public function critical($message, array $context = []): void
{
$this->logger->critical($message, $context);
}

/**
* {@inheritDoc}
*/
public function error($message, array $context = [])
public function error($message, array $context = []): void
{
$this->logger->error($message, $context);
}

/**
* {@inheritDoc}
*/
public function warning($message, array $context = [])
public function warning($message, array $context = []): void
{
$this->logger->warning($message, $context);
}

/**
* {@inheritDoc}
*/
public function notice($message, array $context = [])
public function notice($message, array $context = []): void
{
$this->logger->notice($message, $context);
}

/**
* {@inheritDoc}
*/
public function info($message, array $context = [])
public function info($message, array $context = []): void
{
$this->logger->info($message, $context);
}

/**
* {@inheritDoc}
*/
public function debug($message, array $context = [])
public function debug($message, array $context = []): void
{
$this->logger->debug($message, $context);
}

/**
* {@inheritDoc}
*/
public function log($level, $message, array $context = [])
public function log($level, $message, array $context = []): void
{
$this->logger->log($level, $message, $context);
}
Expand Down
27 changes: 9 additions & 18 deletions src/Log/StdoutLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,82 +31,73 @@ class StdoutLogger implements LoggerInterface
{
/**
* @param string $message
* @return void
*/
public function emergency($message, array $context = [])
public function emergency($message, array $context = []): void
{
$this->log(LogLevel::EMERGENCY, $message, $context);
}

/**
* @param string $message
* @return void
*/
public function alert($message, array $context = [])
public function alert($message, array $context = []): void
{
$this->log(LogLevel::ALERT, $message, $context);
}

/**
* @param string $message
* @return void
*/
public function critical($message, array $context = [])
public function critical($message, array $context = []): void
{
$this->log(LogLevel::CRITICAL, $message, $context);
}

/**
* @param string $message
* @return void
*/
public function error($message, array $context = [])
public function error($message, array $context = []): void
{
$this->log(LogLevel::ERROR, $message, $context);
}

/**
* @param string $message
* @return void
*/
public function warning($message, array $context = [])
public function warning($message, array $context = []): void
{
$this->log(LogLevel::WARNING, $message, $context);
}

/**
* @param string $message
* @return void
*/
public function notice($message, array $context = [])
public function notice($message, array $context = []): void
{
$this->log(LogLevel::NOTICE, $message, $context);
}

/**
* @param string $message
* @return void
*/
public function info($message, array $context = [])
public function info($message, array $context = []): void
{
$this->log(LogLevel::INFO, $message, $context);
}

/**
* @param string $message
* @return void
*/
public function debug($message, array $context = [])
public function debug($message, array $context = []): void
{
$this->log(LogLevel::DEBUG, $message, $context);
}

/**
* @param mixed $level Generally a string from a LogLevel constant.
* @param string $message
* @return void
*/
public function log($level, $message, array $context = [])
public function log($level, $message, array $context = []): void
{
foreach ($context as $key => $value) {
$value = is_string($value) || is_array($value) ? $value : (string) $value;
Expand Down