1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-02 19:27:37 +02:00
This commit is contained in:
Jordi Boggiano
2015-03-01 14:12:35 +00:00
parent 951f024bfb
commit 995a61bec8
9 changed files with 25 additions and 16 deletions

15
.php_cs Normal file
View File

@@ -0,0 +1,15 @@
<?php
$finder = Symfony\CS\Finder\DefaultFinder::create()
->files()
->name('*.php')
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
;
return Symfony\CS\Config\Config::create()
->fixers(array(
'psr0', 'encoding', 'short_tag', 'braces', 'elseif', 'eof_ending', 'function_declaration', 'indentation', 'line_after_namespace', 'linefeed', 'lowercase_constants', 'lowercase_keywords', 'multiple_use', 'php_closing_tag', 'trailing_spaces', 'visibility', 'duplicate_semicolon', 'extra_empty_lines', 'include', 'namespace_no_leading_whitespace', 'object_operator', 'operators_spaces', 'phpdoc_params', 'return', 'single_array_no_trailing_comma', 'spaces_cast', 'standardize_not_equal', 'ternary_spaces', 'unused_use', 'whitespacy_lines',
))
->finder($finder)
;

View File

@@ -11,7 +11,6 @@
namespace Monolog\Handler; namespace Monolog\Handler;
/** /**
* Sampling handler * Sampling handler
* *

View File

@@ -157,11 +157,8 @@ class SlackHandler extends SocketHandler
} }
if ($this->includeExtra) { if ($this->includeExtra) {
if (!empty($record['extra'])) { if (!empty($record['extra'])) {
if ($this->useShortAttachment) { if ($this->useShortAttachment) {
$attachment['fields'][] = array( $attachment['fields'][] = array(
'title' => "Extra", 'title' => "Extra",
'value' => $this->stringify($record['extra']), 'value' => $this->stringify($record['extra']),
@@ -180,9 +177,7 @@ class SlackHandler extends SocketHandler
} }
if (!empty($record['context'])) { if (!empty($record['context'])) {
if ($this->useShortAttachment) { if ($this->useShortAttachment) {
$attachment['fields'][] = array( $attachment['fields'][] = array(
'title' => "Context", 'title' => "Context",
'value' => $this->stringify($record['context']), 'value' => $this->stringify($record['context']),

View File

@@ -72,6 +72,7 @@ class Registry
{ {
if ($logger instanceof Logger) { if ($logger instanceof Logger) {
$index = array_search($logger, self::$loggers, true); $index = array_search($logger, self::$loggers, true);
return false !== $index; return false !== $index;
} else { } else {
return isset(self::$loggers[$logger]); return isset(self::$loggers[$logger]);

View File

@@ -24,7 +24,7 @@ class GelfHandlerLegacyTest extends TestCase
$this->markTestSkipped("mlehner/gelf-php not installed"); $this->markTestSkipped("mlehner/gelf-php not installed");
} }
require_once __DIR__ . '/GelfMocks.php'; require_once __DIR__ . '/GelfMockMessagePublisher.php';
} }
/** /**
@@ -45,7 +45,7 @@ class GelfHandlerLegacyTest extends TestCase
protected function getMessagePublisher() protected function getMessagePublisher()
{ {
return new MockMessagePublisher('localhost'); return new GelfMockMessagePublisher('localhost');
} }
public function testDebug() public function testDebug()

View File

@@ -14,7 +14,7 @@ namespace Monolog\Handler;
use Gelf\MessagePublisher; use Gelf\MessagePublisher;
use Gelf\Message; use Gelf\Message;
class MockMessagePublisher extends MessagePublisher class GelfMockMessagePublisher extends MessagePublisher
{ {
public function publish(Message $message) public function publish(Message $message)
{ {

View File

@@ -11,8 +11,6 @@
namespace Monolog; namespace Monolog;
use Monolog\Logger;
use Monolog\Registry;
class RegistryTest extends \PHPUnit_Framework_TestCase class RegistryTest extends \PHPUnit_Framework_TestCase
{ {
@@ -40,6 +38,7 @@ class RegistryTest extends \PHPUnit_Framework_TestCase
$logger1 = new Logger('test1'); $logger1 = new Logger('test1');
$logger2 = new Logger('test2'); $logger2 = new Logger('test2');
$logger3 = new Logger('test3'); $logger3 = new Logger('test3');
return array( return array(
// only instances // only instances
array( array(