mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-25 10:36:33 +02:00
Fix CS
This commit is contained in:
@@ -93,7 +93,7 @@ class HtmlFormatter extends NormalizerFormatter
|
||||
if ($record['context']) {
|
||||
$embeddedTable = '<table cellspacing="1" width="100%">';
|
||||
foreach ($record['context'] as $key => $value) {
|
||||
$embeddedTable .= $this->addRow((string)$key, $this->convertToString($value));
|
||||
$embeddedTable .= $this->addRow((string) $key, $this->convertToString($value));
|
||||
}
|
||||
$embeddedTable .= '</table>';
|
||||
$output .= $this->addRow('Context', $embeddedTable, false);
|
||||
@@ -101,7 +101,7 @@ class HtmlFormatter extends NormalizerFormatter
|
||||
if ($record['extra']) {
|
||||
$embeddedTable = '<table cellspacing="1" width="100%">';
|
||||
foreach ($record['extra'] as $key => $value) {
|
||||
$embeddedTable .= $this->addRow((string)$key, $this->convertToString($value));
|
||||
$embeddedTable .= $this->addRow((string) $key, $this->convertToString($value));
|
||||
}
|
||||
$embeddedTable .= '</table>';
|
||||
$output .= $this->addRow('Extra', $embeddedTable, false);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
namespace Monolog\Formatter;
|
||||
|
||||
use Monolog\Utils;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
|
||||
@@ -203,7 +203,7 @@ class NormalizerFormatter implements FormatterInterface
|
||||
}
|
||||
|
||||
if (isset($e->detail)) {
|
||||
if (is_string($e->detail)) {
|
||||
if (is_string($e->detail)) {
|
||||
$data['detail'] = $e->detail;
|
||||
} elseif (is_object($e->detail) || is_array($e->detail)) {
|
||||
$data['detail'] = $this->toJson($e->detail, true);
|
||||
@@ -230,7 +230,7 @@ class NormalizerFormatter implements FormatterInterface
|
||||
*
|
||||
* @param mixed $data
|
||||
* @throws \RuntimeException if encoding fails and errors are not ignored
|
||||
* @return string if encoding fails and ignoreErrors is true 'null' is returned
|
||||
* @return string if encoding fails and ignoreErrors is true 'null' is returned
|
||||
*/
|
||||
protected function toJson($data, bool $ignoreErrors = false): string
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ class FallbackGroupHandler extends GroupHandler
|
||||
// What throwable?
|
||||
}
|
||||
}
|
||||
|
||||
return false === $this->bubble;
|
||||
}
|
||||
|
||||
|
||||
@@ -71,10 +71,10 @@ class ZendMonitorHandler extends AbstractProcessingHandler
|
||||
|
||||
/**
|
||||
* Write to Zend Monitor Events
|
||||
* @param string $type Text displayed in "Class Name (custom)" field
|
||||
* @param string $message Text displayed in "Error String"
|
||||
* @param mixed $formatted Displayed in Custom Variables tab
|
||||
* @param int $severity Set the event severity level (-1,0,1)
|
||||
* @param string $type Text displayed in "Class Name (custom)" field
|
||||
* @param string $message Text displayed in "Error String"
|
||||
* @param mixed $formatted Displayed in Custom Variables tab
|
||||
* @param int $severity Set the event severity level (-1,0,1)
|
||||
*/
|
||||
protected function writeZendMonitorCustomEvent(string $type, string $message, array $formatted, int $severity): void
|
||||
{
|
||||
|
||||
@@ -66,10 +66,10 @@ final class Utils
|
||||
* Return the JSON representation of a value
|
||||
*
|
||||
* @param mixed $data
|
||||
* @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
|
||||
* @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE
|
||||
* @param bool $ignoreErrors whether to ignore encoding errors or to throw on error, when ignored and the encoding fails, "null" is returned which is valid json for null
|
||||
* @throws \RuntimeException if encoding fails and errors are not ignored
|
||||
* @return string when errors are ignored and the encoding fails, "null" is returned which is valid json for null
|
||||
* @return string when errors are ignored and the encoding fails, "null" is returned which is valid json for null
|
||||
*/
|
||||
public static function jsonEncode($data, ?int $encodeFlags = null, bool $ignoreErrors = false): string
|
||||
{
|
||||
@@ -102,8 +102,8 @@ final class Utils
|
||||
* initial error is not encoding related or the input can't be cleaned then
|
||||
* raise a descriptive exception.
|
||||
*
|
||||
* @param int $code return code of json_last_error function
|
||||
* @param mixed $data data that was meant to be encoded
|
||||
* @param int $code return code of json_last_error function
|
||||
* @param mixed $data data that was meant to be encoded
|
||||
* @param int $encodeFlags flags to pass to json encode, defaults to JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION
|
||||
* @throws \RuntimeException if failure can't be corrected
|
||||
* @return string JSON encoded data after error correction
|
||||
|
||||
Reference in New Issue
Block a user