aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/psr/log/Psr
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2016-10-19 16:31:35 -0700
committerzotlabs <mike@macgirvin.com>2016-10-19 16:31:35 -0700
commitc79c1b391331ab7c8c0f01265a627ffae23d54e2 (patch)
tree66d988e77e1af2b8695a9726a76fc7d5743a69a6 /vendor/psr/log/Psr
parent716a83d1f77e2d6f26b25ab03ffe130c11ef7feb (diff)
parentb926a4c67e4d7dcba01df91dddcc047abde246bb (diff)
downloadvolse-hubzilla-c79c1b391331ab7c8c0f01265a627ffae23d54e2.tar.gz
volse-hubzilla-c79c1b391331ab7c8c0f01265a627ffae23d54e2.tar.bz2
volse-hubzilla-c79c1b391331ab7c8c0f01265a627ffae23d54e2.zip
Merge branch 'dev' into pdo
Diffstat (limited to 'vendor/psr/log/Psr')
-rw-r--r--vendor/psr/log/Psr/Log/AbstractLogger.php40
-rw-r--r--vendor/psr/log/Psr/Log/LogLevel.php16
-rw-r--r--vendor/psr/log/Psr/Log/LoggerAwareInterface.php7
-rw-r--r--vendor/psr/log/Psr/Log/LoggerAwareTrait.php8
-rw-r--r--vendor/psr/log/Psr/Log/LoggerInterface.php51
-rw-r--r--vendor/psr/log/Psr/Log/LoggerTrait.php51
-rw-r--r--vendor/psr/log/Psr/Log/NullLogger.php9
-rw-r--r--vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php116
8 files changed, 107 insertions, 191 deletions
diff --git a/vendor/psr/log/Psr/Log/AbstractLogger.php b/vendor/psr/log/Psr/Log/AbstractLogger.php
index 00f903452..90e721af2 100644
--- a/vendor/psr/log/Psr/Log/AbstractLogger.php
+++ b/vendor/psr/log/Psr/Log/AbstractLogger.php
@@ -15,8 +15,9 @@ abstract class AbstractLogger implements LoggerInterface
* System is unusable.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function emergency($message, array $context = array())
{
@@ -30,8 +31,9 @@ abstract class AbstractLogger implements LoggerInterface
* trigger the SMS alerts and wake you up.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function alert($message, array $context = array())
{
@@ -44,8 +46,9 @@ abstract class AbstractLogger implements LoggerInterface
* Example: Application component unavailable, unexpected exception.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function critical($message, array $context = array())
{
@@ -57,8 +60,9 @@ abstract class AbstractLogger implements LoggerInterface
* be logged and monitored.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function error($message, array $context = array())
{
@@ -72,8 +76,9 @@ abstract class AbstractLogger implements LoggerInterface
* that are not necessarily wrong.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function warning($message, array $context = array())
{
@@ -84,8 +89,9 @@ abstract class AbstractLogger implements LoggerInterface
* Normal but significant events.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function notice($message, array $context = array())
{
@@ -98,8 +104,9 @@ abstract class AbstractLogger implements LoggerInterface
* Example: User logs in, SQL logs.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function info($message, array $context = array())
{
@@ -110,8 +117,9 @@ abstract class AbstractLogger implements LoggerInterface
* Detailed debug information.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function debug($message, array $context = array())
{
diff --git a/vendor/psr/log/Psr/Log/LogLevel.php b/vendor/psr/log/Psr/Log/LogLevel.php
index e32c151cb..9cebcace6 100644
--- a/vendor/psr/log/Psr/Log/LogLevel.php
+++ b/vendor/psr/log/Psr/Log/LogLevel.php
@@ -3,16 +3,16 @@
namespace Psr\Log;
/**
- * Describes log levels
+ * Describes log levels.
*/
class LogLevel
{
const EMERGENCY = 'emergency';
- const ALERT = 'alert';
- const CRITICAL = 'critical';
- const ERROR = 'error';
- const WARNING = 'warning';
- const NOTICE = 'notice';
- const INFO = 'info';
- const DEBUG = 'debug';
+ const ALERT = 'alert';
+ const CRITICAL = 'critical';
+ const ERROR = 'error';
+ const WARNING = 'warning';
+ const NOTICE = 'notice';
+ const INFO = 'info';
+ const DEBUG = 'debug';
}
diff --git a/vendor/psr/log/Psr/Log/LoggerAwareInterface.php b/vendor/psr/log/Psr/Log/LoggerAwareInterface.php
index 2eebc4ebd..4d64f4786 100644
--- a/vendor/psr/log/Psr/Log/LoggerAwareInterface.php
+++ b/vendor/psr/log/Psr/Log/LoggerAwareInterface.php
@@ -3,15 +3,16 @@
namespace Psr\Log;
/**
- * Describes a logger-aware instance
+ * Describes a logger-aware instance.
*/
interface LoggerAwareInterface
{
/**
- * Sets a logger instance on the object
+ * Sets a logger instance on the object.
*
* @param LoggerInterface $logger
- * @return null
+ *
+ * @return void
*/
public function setLogger(LoggerInterface $logger);
}
diff --git a/vendor/psr/log/Psr/Log/LoggerAwareTrait.php b/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
index f087a3dac..639f79bda 100644
--- a/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
+++ b/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
@@ -7,12 +7,16 @@ namespace Psr\Log;
*/
trait LoggerAwareTrait
{
- /** @var LoggerInterface */
+ /**
+ * The logger instance.
+ *
+ * @var LoggerInterface
+ */
protected $logger;
/**
* Sets a logger.
- *
+ *
* @param LoggerInterface $logger
*/
public function setLogger(LoggerInterface $logger)
diff --git a/vendor/psr/log/Psr/Log/LoggerInterface.php b/vendor/psr/log/Psr/Log/LoggerInterface.php
index 476bb962a..5ea72438b 100644
--- a/vendor/psr/log/Psr/Log/LoggerInterface.php
+++ b/vendor/psr/log/Psr/Log/LoggerInterface.php
@@ -3,14 +3,14 @@
namespace Psr\Log;
/**
- * Describes a logger instance
+ * Describes a logger instance.
*
* The message MUST be a string or object implementing __toString().
*
* The message MAY contain placeholders in the form: {foo} where foo
* will be replaced by the context data in key "foo".
*
- * The context array can contain arbitrary data, the only assumption that
+ * The context array can contain arbitrary data. The only assumption that
* can be made by implementors is that if an Exception instance is given
* to produce a stack trace, it MUST be in a key named "exception".
*
@@ -23,8 +23,9 @@ interface LoggerInterface
* System is unusable.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function emergency($message, array $context = array());
@@ -35,8 +36,9 @@ interface LoggerInterface
* trigger the SMS alerts and wake you up.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function alert($message, array $context = array());
@@ -46,8 +48,9 @@ interface LoggerInterface
* Example: Application component unavailable, unexpected exception.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function critical($message, array $context = array());
@@ -56,8 +59,9 @@ interface LoggerInterface
* be logged and monitored.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function error($message, array $context = array());
@@ -68,8 +72,9 @@ interface LoggerInterface
* that are not necessarily wrong.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function warning($message, array $context = array());
@@ -77,8 +82,9 @@ interface LoggerInterface
* Normal but significant events.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function notice($message, array $context = array());
@@ -88,8 +94,9 @@ interface LoggerInterface
* Example: User logs in, SQL logs.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function info($message, array $context = array());
@@ -97,18 +104,20 @@ interface LoggerInterface
* Detailed debug information.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function debug($message, array $context = array());
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
+ * @param mixed $level
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function log($level, $message, array $context = array());
}
diff --git a/vendor/psr/log/Psr/Log/LoggerTrait.php b/vendor/psr/log/Psr/Log/LoggerTrait.php
index 591249600..867225df1 100644
--- a/vendor/psr/log/Psr/Log/LoggerTrait.php
+++ b/vendor/psr/log/Psr/Log/LoggerTrait.php
@@ -6,8 +6,8 @@ namespace Psr\Log;
* This is a simple Logger trait that classes unable to extend AbstractLogger
* (because they extend another class, etc) can include.
*
- * 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
+ * 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.
*/
trait LoggerTrait
@@ -16,8 +16,9 @@ trait LoggerTrait
* System is unusable.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function emergency($message, array $context = array())
{
@@ -31,8 +32,9 @@ trait LoggerTrait
* trigger the SMS alerts and wake you up.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function alert($message, array $context = array())
{
@@ -45,8 +47,9 @@ trait LoggerTrait
* Example: Application component unavailable, unexpected exception.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function critical($message, array $context = array())
{
@@ -58,8 +61,9 @@ trait LoggerTrait
* be logged and monitored.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function error($message, array $context = array())
{
@@ -73,8 +77,9 @@ trait LoggerTrait
* that are not necessarily wrong.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function warning($message, array $context = array())
{
@@ -85,8 +90,9 @@ trait LoggerTrait
* Normal but significant events.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function notice($message, array $context = array())
{
@@ -99,8 +105,9 @@ trait LoggerTrait
* Example: User logs in, SQL logs.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function info($message, array $context = array())
{
@@ -111,8 +118,9 @@ trait LoggerTrait
* Detailed debug information.
*
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function debug($message, array $context = array())
{
@@ -122,10 +130,11 @@ trait LoggerTrait
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
+ * @param mixed $level
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
abstract public function log($level, $message, array $context = array());
}
diff --git a/vendor/psr/log/Psr/Log/NullLogger.php b/vendor/psr/log/Psr/Log/NullLogger.php
index 553a3c593..d8cd682c8 100644
--- a/vendor/psr/log/Psr/Log/NullLogger.php
+++ b/vendor/psr/log/Psr/Log/NullLogger.php
@@ -3,7 +3,7 @@
namespace Psr\Log;
/**
- * This Logger can be used to avoid conditional log calls
+ * This Logger can be used to avoid conditional log calls.
*
* Logging should always be optional, and if no logger is provided to your
* library creating a NullLogger instance to have something to throw logs at
@@ -15,10 +15,11 @@ class NullLogger extends AbstractLogger
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
+ * @param mixed $level
* @param string $message
- * @param array $context
- * @return null
+ * @param array $context
+ *
+ * @return void
*/
public function log($level, $message, array $context = array())
{
diff --git a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
deleted file mode 100644
index a93281511..000000000
--- a/vendor/psr/log/Psr/Log/Test/LoggerInterfaceTest.php
+++ /dev/null
@@ -1,116 +0,0 @@
-<?php
-
-namespace Psr\Log\Test;
-
-use Psr\Log\LogLevel;
-
-/**
- * Provides a base test class for ensuring compliance with the LoggerInterface
- *
- * Implementors can extend the class and implement abstract methods to run this as part of their test suite
- */
-abstract class LoggerInterfaceTest extends \PHPUnit_Framework_TestCase
-{
- /**
- * @return LoggerInterface
- */
- abstract function getLogger();
-
- /**
- * This must return the log messages in order with a simple formatting: "<LOG LEVEL> <MESSAGE>"
- *
- * Example ->error('Foo') would yield "error Foo"
- *
- * @return string[]
- */
- abstract function getLogs();
-
- public function testImplements()
- {
- $this->assertInstanceOf('Psr\Log\LoggerInterface', $this->getLogger());
- }
-
- /**
- * @dataProvider provideLevelsAndMessages
- */
- public function testLogsAtAllLevels($level, $message)
- {
- $logger = $this->getLogger();
- $logger->{$level}($message, array('user' => 'Bob'));
- $logger->log($level, $message, array('user' => 'Bob'));
-
- $expected = array(
- $level.' message of level '.$level.' with context: Bob',
- $level.' message of level '.$level.' with context: Bob',
- );
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function provideLevelsAndMessages()
- {
- return array(
- LogLevel::EMERGENCY => array(LogLevel::EMERGENCY, 'message of level emergency with context: {user}'),
- LogLevel::ALERT => array(LogLevel::ALERT, 'message of level alert with context: {user}'),
- LogLevel::CRITICAL => array(LogLevel::CRITICAL, 'message of level critical with context: {user}'),
- LogLevel::ERROR => array(LogLevel::ERROR, 'message of level error with context: {user}'),
- LogLevel::WARNING => array(LogLevel::WARNING, 'message of level warning with context: {user}'),
- LogLevel::NOTICE => array(LogLevel::NOTICE, 'message of level notice with context: {user}'),
- LogLevel::INFO => array(LogLevel::INFO, 'message of level info with context: {user}'),
- LogLevel::DEBUG => array(LogLevel::DEBUG, 'message of level debug with context: {user}'),
- );
- }
-
- /**
- * @expectedException Psr\Log\InvalidArgumentException
- */
- public function testThrowsOnInvalidLevel()
- {
- $logger = $this->getLogger();
- $logger->log('invalid level', 'Foo');
- }
-
- public function testContextReplacement()
- {
- $logger = $this->getLogger();
- $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
-
- $expected = array('info {Message {nothing} Bob Bar a}');
- $this->assertEquals($expected, $this->getLogs());
- }
-
- public function testObjectCastToString()
- {
- $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString'));
- $dummy->expects($this->once())
- ->method('__toString')
- ->will($this->returnValue('DUMMY'));
-
- $this->getLogger()->warning($dummy);
- }
-
- public function testContextCanContainAnything()
- {
- $context = array(
- 'bool' => true,
- 'null' => null,
- 'string' => 'Foo',
- 'int' => 0,
- 'float' => 0.5,
- 'nested' => array('with object' => new DummyTest),
- 'object' => new \DateTime,
- 'resource' => fopen('php://memory', 'r'),
- );
-
- $this->getLogger()->warning('Crazy context data', $context);
- }
-
- public function testContextExceptionKeyCanBeExceptionOrOtherValues()
- {
- $this->getLogger()->warning('Random message', array('exception' => 'oops'));
- $this->getLogger()->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail')));
- }
-}
-
-class DummyTest
-{
-} \ No newline at end of file