mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-29 07:50:05 +02:00
Make SlackRecord::stringify() work without a line formatter
This commit is contained in:
@@ -216,10 +216,14 @@ class SlackRecord
|
|||||||
* Stringifies an array of key/value pairs to be used in attachment fields
|
* Stringifies an array of key/value pairs to be used in attachment fields
|
||||||
*
|
*
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
* @return string
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function stringify($fields)
|
public function stringify($fields)
|
||||||
{
|
{
|
||||||
|
if (!$this->lineFormatter) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$string = '';
|
$string = '';
|
||||||
foreach ($fields as $var => $val) {
|
foreach ($fields as $var => $val) {
|
||||||
$string .= $var.': '.$this->lineFormatter->stringify($val)." | ";
|
$string .= $var.': '.$this->lineFormatter->stringify($val)." | ";
|
||||||
|
Reference in New Issue
Block a user