Reedy has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/336822 )
Change subject: Update psr/log to v1.0.2 ...................................................................... Update psr/log to v1.0.2 https://github.com/php-fig/log/compare/1.0.0...1.0.2 https://github.com/php-fig/log/releases/tag/1.0.1 https://github.com/php-fig/log/releases/tag/1.0.2 Change-Id: I7d4e1d7f61c56fb8951744e0a149b4a3df480e5b --- M composer.json M composer.lock M composer/autoload_namespaces.php M composer/autoload_psr4.php M composer/installed.json M psr/log/Psr/Log/AbstractLogger.php M psr/log/Psr/Log/LogLevel.php M psr/log/Psr/Log/LoggerAwareInterface.php M psr/log/Psr/Log/LoggerAwareTrait.php M psr/log/Psr/Log/LoggerInterface.php M psr/log/Psr/Log/LoggerTrait.php M psr/log/Psr/Log/NullLogger.php M psr/log/Psr/Log/Test/LoggerInterfaceTest.php M psr/log/composer.json 14 files changed, 222 insertions(+), 139 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vendor refs/changes/22/336822/1 diff --git a/composer.json b/composer.json index edbc07f..f0cd9d7 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ "pear/pear_exception": "1.0.0", "php": ">=5.5.9", "pimple/pimple": "2.1.1", - "psr/log": "1.0.0", + "psr/log": "1.0.2", "ruflin/elastica": "3.1.1", "stil/gd-text": "1.0.0", "symfony/process": "3.0.4", diff --git a/composer.lock b/composer.lock index 15dc4dd..411108d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "aba325c96d68e697a7ef5c13cafaea1a", - "content-hash": "a62ca8bf9e48b42aa610ca40b9e90ea1", + "hash": "bd584c21af40cc628648796b0ccf8e91", + "content-hash": "008b82e482b471745b498860c2e038b4", "packages": [ { "name": "composer/semver", @@ -1064,22 +1064,30 @@ }, { "name": "psr/log", - "version": "1.0.0", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -1093,12 +1101,13 @@ } ], "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2012-12-21 11:40:51" + "time": "2016-10-10 12:19:37" }, { "name": "ruflin/elastica", diff --git a/composer/autoload_namespaces.php b/composer/autoload_namespaces.php index ca66959..e8e85e8 100644 --- a/composer/autoload_namespaces.php +++ b/composer/autoload_namespaces.php @@ -7,7 +7,6 @@ return array( 'TextCat' => array($vendorDir . '/wikimedia/textcat'), - 'Psr\\Log\\' => array($vendorDir . '/psr/log'), 'Pimple' => array($vendorDir . '/pimple/pimple/src'), 'PEAR' => array($vendorDir . '/pear/pear_exception'), 'Net' => array($vendorDir . '/pear/net_socket', $vendorDir . '/pear/net_smtp'), diff --git a/composer/autoload_psr4.php b/composer/autoload_psr4.php index 4921f11..8984781 100644 --- a/composer/autoload_psr4.php +++ b/composer/autoload_psr4.php @@ -11,6 +11,7 @@ 'Wikimedia\\Assert\\Test\\' => array($vendorDir . '/wikimedia/assert/tests/phpunit'), 'Wikimedia\\Assert\\' => array($vendorDir . '/wikimedia/assert/src'), 'Symfony\\Component\\Process\\' => array($vendorDir . '/symfony/process'), + 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Monolog\\' => array($vendorDir . '/monolog/monolog/src/Monolog'), 'JsonSchema\\' => array($vendorDir . '/justinrainbow/json-schema/src/JsonSchema'), 'GDText\\' => array($vendorDir . '/stil/gd-text/src'), diff --git a/composer/installed.json b/composer/installed.json index 0d73799..77eb7f8 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -923,46 +923,6 @@ ] }, { - "name": "psr/log", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "time": "2012-12-21 11:40:51", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ] - }, - { "name": "wikimedia/composer-merge-plugin", "version": "v1.3.1", "version_normalized": "1.3.1.0", @@ -2089,5 +2049,54 @@ "php", "tags" ] + }, + { + "name": "psr/log", + "version": "1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2016-10-10 12:19:37", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ] } ] diff --git a/psr/log/Psr/Log/AbstractLogger.php b/psr/log/Psr/Log/AbstractLogger.php index 00f9034..90e721a 100644 --- a/psr/log/Psr/Log/AbstractLogger.php +++ b/psr/log/Psr/Log/AbstractLogger.php @@ -15,8 +15,9 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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/psr/log/Psr/Log/LogLevel.php b/psr/log/Psr/Log/LogLevel.php index e32c151..9cebcac 100644 --- a/psr/log/Psr/Log/LogLevel.php +++ b/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/psr/log/Psr/Log/LoggerAwareInterface.php b/psr/log/Psr/Log/LoggerAwareInterface.php index 2eebc4e..4d64f47 100644 --- a/psr/log/Psr/Log/LoggerAwareInterface.php +++ b/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/psr/log/Psr/Log/LoggerAwareTrait.php b/psr/log/Psr/Log/LoggerAwareTrait.php index f087a3d..639f79b 100644 --- a/psr/log/Psr/Log/LoggerAwareTrait.php +++ b/psr/log/Psr/Log/LoggerAwareTrait.php @@ -7,12 +7,16 @@ */ 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/psr/log/Psr/Log/LoggerInterface.php b/psr/log/Psr/Log/LoggerInterface.php index 476bb96..5ea7243 100644 --- a/psr/log/Psr/Log/LoggerInterface.php +++ b/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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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/psr/log/Psr/Log/LoggerTrait.php b/psr/log/Psr/Log/LoggerTrait.php index 5912496..867225d 100644 --- a/psr/log/Psr/Log/LoggerTrait.php +++ b/psr/log/Psr/Log/LoggerTrait.php @@ -6,8 +6,8 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ * 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 @@ /** * 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/psr/log/Psr/Log/NullLogger.php b/psr/log/Psr/Log/NullLogger.php index 553a3c5..d8cd682 100644 --- a/psr/log/Psr/Log/NullLogger.php +++ b/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 @@ /** * 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/psr/log/Psr/Log/Test/LoggerInterfaceTest.php b/psr/log/Psr/Log/Test/LoggerInterfaceTest.php index a932815..a0391a5 100644 --- a/psr/log/Psr/Log/Test/LoggerInterfaceTest.php +++ b/psr/log/Psr/Log/Test/LoggerInterfaceTest.php @@ -2,28 +2,32 @@ namespace Psr\Log\Test; +use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; /** - * Provides a base test class for ensuring compliance with the LoggerInterface + * 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 + * 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(); + abstract public function getLogger(); /** - * This must return the log messages in order with a simple formatting: "<LOG LEVEL> <MESSAGE>" + * This must return the log messages in order. * - * Example ->error('Foo') would yield "error Foo" + * The simple formatting of the messages is: "<LOG LEVEL> <MESSAGE>". + * + * Example ->error('Foo') would yield "error Foo". * * @return string[] */ - abstract function getLogs(); + abstract public function getLogs(); public function testImplements() { @@ -61,7 +65,7 @@ } /** - * @expectedException Psr\Log\InvalidArgumentException + * @expectedException \Psr\Log\InvalidArgumentException */ public function testThrowsOnInvalidLevel() { @@ -80,12 +84,19 @@ public function testObjectCastToString() { - $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); + if (method_exists($this, 'createPartialMock')) { + $dummy = $this->createPartialMock('Psr\Log\Test\DummyTest', array('__toString')); + } else { + $dummy = $this->getMock('Psr\Log\Test\DummyTest', array('__toString')); + } $dummy->expects($this->once()) ->method('__toString') ->will($this->returnValue('DUMMY')); $this->getLogger()->warning($dummy); + + $expected = array('warning DUMMY'); + $this->assertEquals($expected, $this->getLogs()); } public function testContextCanContainAnything() @@ -102,15 +113,28 @@ ); $this->getLogger()->warning('Crazy context data', $context); + + $expected = array('warning Crazy context data'); + $this->assertEquals($expected, $this->getLogs()); } public function testContextExceptionKeyCanBeExceptionOrOtherValues() { - $this->getLogger()->warning('Random message', array('exception' => 'oops')); - $this->getLogger()->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); + $logger = $this->getLogger(); + $logger->warning('Random message', array('exception' => 'oops')); + $logger->critical('Uncaught Exception!', array('exception' => new \LogicException('Fail'))); + + $expected = array( + 'warning Random message', + 'critical Uncaught Exception!' + ); + $this->assertEquals($expected, $this->getLogs()); } } class DummyTest { -} \ No newline at end of file + public function __toString() + { + } +} diff --git a/psr/log/composer.json b/psr/log/composer.json index 6bdcc21..87934d7 100644 --- a/psr/log/composer.json +++ b/psr/log/composer.json @@ -2,6 +2,7 @@ "name": "psr/log", "description": "Common interface for logging libraries", "keywords": ["psr", "psr-3", "log"], + "homepage": "https://github.com/php-fig/log", "license": "MIT", "authors": [ { @@ -9,9 +10,17 @@ "homepage": "http://www.php-fig.org/" } ], + "require": { + "php": ">=5.3.0" + }, "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" } } } -- To view, visit https://gerrit.wikimedia.org/r/336822 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7d4e1d7f61c56fb8951744e0a149b4a3df480e5b Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vendor Gerrit-Branch: master Gerrit-Owner: Reedy <re...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits