1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-23 05:15:29 +02:00

CS fixes & upgrading cs fixer config

This commit is contained in:
Jordi Boggiano
2015-11-18 17:09:41 +00:00
parent 75ca9e5dc7
commit c889fb2648
64 changed files with 288 additions and 218 deletions

View File

@@ -42,7 +42,7 @@ class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
'extra' => array('ip' => '127.0.0.1'),
),
'unknown',
'error'
'error',
),
$message
);
@@ -75,7 +75,7 @@ class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
'extra' => array('ip' => '127.0.0.1'),
),
'test : 14',
'error'
'error',
),
$message
);
@@ -104,7 +104,7 @@ class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
'meh',
'log',
'unknown',
'log'
'log',
),
$message
);
@@ -143,13 +143,13 @@ class ChromePHPFormatterTest extends \PHPUnit_Framework_TestCase
'meh',
'log',
'unknown',
'info'
'info',
),
array(
'foo',
'log2',
'unknown',
'warn'
'warn',
),
),
$formatter->formatBatch($records)

View File

@@ -108,7 +108,7 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger'),
'datetime' => new \DateTime("@0"),
'extra' => array('key' => 'pair'),
'message' => 'log'
'message' => 'log',
);
$message = $formatter->format($record);
@@ -145,11 +145,11 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger', 'exception' => array(
'class' => '\Exception',
'file' => '/some/file/in/dir.php:56',
'trace' => array('/some/file/1.php:23', '/some/file/2.php:3')
'trace' => array('/some/file/1.php:23', '/some/file/2.php:3'),
)),
'datetime' => new \DateTime("@0"),
'extra' => array(),
'message' => 'log'
'message' => 'log',
);
$message = $formatter->format($record);
@@ -173,7 +173,7 @@ class GelfMessageFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger'),
'datetime' => new \DateTime("@0"),
'extra' => array('key' => 'pair'),
'message' => 'log'
'message' => 'log',
);
$message = $formatter->format($record);

View File

@@ -44,7 +44,7 @@ class LineFormatterTest extends \PHPUnit_Framework_TestCase
'baz' => 'qux',
'bool' => false,
'null' => null,
)
),
));
$this->assertEquals('['.date('Y-m-d').'] meh.ERROR: foo {"foo":"bar","baz":"qux","bool":false,"null":null} []'."\n", $message);
}

View File

@@ -83,7 +83,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger'),
'datetime' => new \DateTime("@0"),
'extra' => array('key' => 'pair'),
'message' => 'log'
'message' => 'log',
);
$message = json_decode($formatter->format($record), true);
@@ -116,7 +116,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger'),
'datetime' => new \DateTime("@0"),
'extra' => array('key' => 'pair'),
'message' => 'log'
'message' => 'log',
);
$message = json_decode($formatter->format($record), true);
@@ -146,7 +146,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger'),
'datetime' => new \DateTime("@0"),
'extra' => array('key' => 'pair'),
'message' => 'log'
'message' => 'log',
);
$message = json_decode($formatter->format($record), true);
@@ -223,7 +223,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger'),
'datetime' => new \DateTime("@0"),
'extra' => array('key' => 'pair'),
'message' => 'log'
'message' => 'log',
);
$message = json_decode($formatter->format($record), true);
@@ -252,7 +252,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger'),
'datetime' => new \DateTime("@0"),
'extra' => array('key' => 'pair'),
'message' => 'log'
'message' => 'log',
);
$message = json_decode($formatter->format($record), true);
@@ -278,7 +278,7 @@ class LogstashFormatterTest extends \PHPUnit_Framework_TestCase
'context' => array('from' => 'logger'),
'datetime' => new \DateTime("@0"),
'extra' => array('key' => 'pair'),
'message' => 'log'
'message' => 'log',
);
$message = json_decode($formatter->format($record), true);

View File

@@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
use Monolog\Logger;
@@ -128,9 +137,9 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
'property' => 'anything',
'nest3' => array(
'nest4' => 'value',
'property' => 'nothing'
)
)
'property' => 'nothing',
),
),
),
'level' => Logger::WARNING,
'level_name' => Logger::getLevelName(Logger::WARNING),
@@ -147,7 +156,7 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
'nest2' => array(
'property' => 'anything',
'nest3' => '[...]',
)
),
),
$formattedResult['context']
);
@@ -165,8 +174,8 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
'nest4' => array(
'property' => 'nothing',
),
)
)
),
),
),
'level' => Logger::WARNING,
'level_name' => Logger::getLevelName(Logger::WARNING),
@@ -186,9 +195,9 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
'property' => 'anything',
'nest4' => array(
'property' => 'nothing',
)
),
),
)
),
),
$formattedResult['context']
);
@@ -205,7 +214,7 @@ class MongoDBFormatterTest extends \PHPUnit_Framework_TestCase
$record = array(
'message' => 'some log message',
'context' => array(
'nest2' => $someObject
'nest2' => $someObject,
),
'level' => Logger::WARNING,
'level_name' => Logger::getLevelName(Logger::WARNING),

View File

@@ -51,7 +51,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
'inf' => 'INF',
'-inf' => '-INF',
'nan' => 'NaN',
)
),
), $formatted);
}
@@ -74,7 +74,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
'message' => $e2->getMessage(),
'code' => $e2->getCode(),
'file' => $e2->getFile().':'.$e2->getLine(),
)
),
), $formatted);
}
@@ -284,4 +284,4 @@ class TestToStringError
{
throw new \RuntimeException('Could not convert to string');
}
}
}

View File

@@ -1,4 +1,14 @@
<?php
/*
* This file is part of the Monolog package.
*
* (c) Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Monolog\Formatter;
class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
@@ -44,7 +54,7 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
'bam' => array(1, 2, 3),
'bat' => array('foo' => 'bar'),
'bap' => \DateTime::createFromFormat(\DateTime::ISO8601, '1970-01-01T00:00:00+0000'),
'ban' => $exception
'ban' => $exception,
));
$this->assertSame(array(
@@ -59,8 +69,8 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
'file' => $exception->getFile() . ':' . $exception->getLine(),
'trace' => $this->buildTrace($exception)
))
'trace' => $this->buildTrace($exception),
)),
), $formatted);
}
@@ -68,11 +78,11 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
{
$context = array('file' => 'foo', 'line' => 1);
$formatted = $this->formatter->format(array(
'context' => $context
'context' => $context,
));
$this->assertSame(array(
'context' => $this->encodeJson($context)
'context' => $this->encodeJson($context),
), $formatted);
}
@@ -81,8 +91,8 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
$exception = new \Exception('foo');
$formatted = $this->formatter->format(array(
'context' => array(
'exception' => $exception
)
'exception' => $exception,
),
));
$this->assertSame(array(
@@ -92,9 +102,9 @@ class ScalarFormatterTest extends \PHPUnit_Framework_TestCase
'message' => $exception->getMessage(),
'code' => $exception->getCode(),
'file' => $exception->getFile() . ':' . $exception->getLine(),
'trace' => $this->buildTrace($exception)
)
))
'trace' => $this->buildTrace($exception),
),
)),
), $formatted);
}
}