for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SimpleLog\Message;
class DefaultJsonMessage extends DefaultMessage
{
/**
* @var array
*/
protected $message = [
'date' => '',
'time' => '',
'data' => '',
];
protected $context = [];
* @param string|array|object $message
* @param array $context
* @return $this
public function createMessage($message, array $context)
$this->context = $context;
list($date, $time) = explode(';', strftime('%d-%m-%Y;%H:%M:%S', time()));
$this->message['date'] = $date;
$this->message['time'] = $time;
if (method_exists($message, '__toString')) {
$message = (string)$message;
}
$this->message['data'] = $message;
return $this;
* @return string
public function getMessage()
$this->message = json_encode($this->message);
json_encode($this->message)
string
array
$message
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..
$this->buildContext($this->context);
return $this->message;
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..