Skip to content
Closed
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
vendor
composer.lock
.idea
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎 This belongs in your global ignore file.

16 changes: 8 additions & 8 deletions Psr/Log/AbstractLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ abstract class AbstractLogger implements LoggerInterface
*
* @return void
*/
public function emergency($message, array $context = array())
public function emergency(string $message, array $context = []):void
{
$this->log(LogLevel::EMERGENCY, $message, $context);
}
Expand All @@ -35,7 +35,7 @@ public function emergency($message, array $context = array())
*
* @return void
*/
public function alert($message, array $context = array())
public function alert(string $message, array $context = []):void
{
$this->log(LogLevel::ALERT, $message, $context);
}
Expand All @@ -50,7 +50,7 @@ public function alert($message, array $context = array())
*
* @return void
*/
public function critical($message, array $context = array())
public function critical(string $message, array $context = []):void
{
$this->log(LogLevel::CRITICAL, $message, $context);
}
Expand All @@ -64,7 +64,7 @@ public function critical($message, array $context = array())
*
* @return void
*/
public function error($message, array $context = array())
public function error(string $message, array $context = []):void
{
$this->log(LogLevel::ERROR, $message, $context);
}
Expand All @@ -80,7 +80,7 @@ public function error($message, array $context = array())
*
* @return void
*/
public function warning($message, array $context = array())
public function warning(string $message, array $context = []):void
{
$this->log(LogLevel::WARNING, $message, $context);
}
Expand All @@ -93,7 +93,7 @@ public function warning($message, array $context = array())
*
* @return void
*/
public function notice($message, array $context = array())
public function notice(string $message, array $context = []):void
{
$this->log(LogLevel::NOTICE, $message, $context);
}
Expand All @@ -108,7 +108,7 @@ public function notice($message, array $context = array())
*
* @return void
*/
public function info($message, array $context = array())
public function info(string $message, array $context = []):void
{
$this->log(LogLevel::INFO, $message, $context);
}
Expand All @@ -121,7 +121,7 @@ public function info($message, array $context = array())
*
* @return void
*/
public function debug($message, array $context = array())
public function debug(string $message, array $context = []):void
{
$this->log(LogLevel::DEBUG, $message, $context);
}
Expand Down
2 changes: 1 addition & 1 deletion Psr/Log/LoggerAwareInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ interface LoggerAwareInterface
*
* @return void
*/
public function setLogger(LoggerInterface $logger);
public function setLogger(LoggerInterface $logger):void;
}
4 changes: 3 additions & 1 deletion Psr/Log/LoggerAwareTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ trait LoggerAwareTrait
* Sets a logger.
*
* @param LoggerInterface $logger
*
* @return void
*/
public function setLogger(LoggerInterface $logger)
public function setLogger(LoggerInterface $logger):void
{
$this->logger = $logger;
}
Expand Down
18 changes: 9 additions & 9 deletions Psr/Log/LoggerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface LoggerInterface
*
* @return void
*/
public function emergency($message, array $context = array());
public function emergency(string $message, array $context = []):void;

/**
* Action must be taken immediately.
Expand All @@ -40,7 +40,7 @@ public function emergency($message, array $context = array());
*
* @return void
*/
public function alert($message, array $context = array());
public function alert(string $message, array $context = []):void;

/**
* Critical conditions.
Expand All @@ -52,7 +52,7 @@ public function alert($message, array $context = array());
*
* @return void
*/
public function critical($message, array $context = array());
public function critical(string $message, array $context = []):void;

/**
* Runtime errors that do not require immediate action but should typically
Expand All @@ -63,7 +63,7 @@ public function critical($message, array $context = array());
*
* @return void
*/
public function error($message, array $context = array());
public function error(string $message, array $context = []):void;

/**
* Exceptional occurrences that are not errors.
Expand All @@ -76,7 +76,7 @@ public function error($message, array $context = array());
*
* @return void
*/
public function warning($message, array $context = array());
public function warning(string $message, array $context = []):void;

/**
* Normal but significant events.
Expand All @@ -86,7 +86,7 @@ public function warning($message, array $context = array());
*
* @return void
*/
public function notice($message, array $context = array());
public function notice(string $message, array $context = []):void;

/**
* Interesting events.
Expand All @@ -98,7 +98,7 @@ public function notice($message, array $context = array());
*
* @return void
*/
public function info($message, array $context = array());
public function info(string $message, array $context = []):void;

/**
* Detailed debug information.
Expand All @@ -108,7 +108,7 @@ public function info($message, array $context = array());
*
* @return void
*/
public function debug($message, array $context = array());
public function debug(string $message, array $context = []):void;

/**
* Logs with an arbitrary level.
Expand All @@ -119,5 +119,5 @@ public function debug($message, array $context = array());
*
* @return void
*/
public function log($level, $message, array $context = array());
public function log($level, string $message, array $context = []):void;
}
18 changes: 9 additions & 9 deletions Psr/Log/LoggerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ trait LoggerTrait
*
* @return void
*/
public function emergency($message, array $context = array())
public function emergency(string $message, array $context = []):void
{
$this->log(LogLevel::EMERGENCY, $message, $context);
}
Expand All @@ -36,7 +36,7 @@ public function emergency($message, array $context = array())
*
* @return void
*/
public function alert($message, array $context = array())
public function alert(string $message, array $context = []):void
{
$this->log(LogLevel::ALERT, $message, $context);
}
Expand All @@ -51,7 +51,7 @@ public function alert($message, array $context = array())
*
* @return void
*/
public function critical($message, array $context = array())
public function critical(string $message, array $context = []):void
{
$this->log(LogLevel::CRITICAL, $message, $context);
}
Expand All @@ -65,7 +65,7 @@ public function critical($message, array $context = array())
*
* @return void
*/
public function error($message, array $context = array())
public function error(string $message, array $context = []):void
{
$this->log(LogLevel::ERROR, $message, $context);
}
Expand All @@ -81,7 +81,7 @@ public function error($message, array $context = array())
*
* @return void
*/
public function warning($message, array $context = array())
public function warning(string $message, array $context = []):void
{
$this->log(LogLevel::WARNING, $message, $context);
}
Expand All @@ -94,7 +94,7 @@ public function warning($message, array $context = array())
*
* @return void
*/
public function notice($message, array $context = array())
public function notice(string $message, array $context = []):void
{
$this->log(LogLevel::NOTICE, $message, $context);
}
Expand All @@ -109,7 +109,7 @@ public function notice($message, array $context = array())
*
* @return void
*/
public function info($message, array $context = array())
public function info(string $message, array $context = []):void
{
$this->log(LogLevel::INFO, $message, $context);
}
Expand All @@ -122,7 +122,7 @@ public function info($message, array $context = array())
*
* @return void
*/
public function debug($message, array $context = array())
public function debug(string $message, array $context = []):void
{
$this->log(LogLevel::DEBUG, $message, $context);
}
Expand All @@ -136,5 +136,5 @@ public function debug($message, array $context = array())
*
* @return void
*/
abstract public function log($level, $message, array $context = array());
abstract public function log($level, string $message, array $context = []):void;
}
2 changes: 1 addition & 1 deletion Psr/Log/NullLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class NullLogger extends AbstractLogger
*
* @return void
*/
public function log($level, $message, array $context = array())
public function log($level, string $message, array $context = []):void
{
// noop
}
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": ">=5.3.0"
"php": ">=7.1.0"
},
"autoload": {
"psr-4": {
Expand All @@ -20,7 +20,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "2.0.x-dev"
}
}
}