作者 竞泽

style:format

... ... @@ -22,7 +22,7 @@ class Ding implements AgentInterface
$talk->setTextMessage(join("\n", $content))->send();
}
public function dsiabled(): bool
public function disabled(): bool
{
return !$this->enable;
}
... ...
... ... @@ -35,7 +35,7 @@ class Wx implements AgentInterface
]);
}
public function dsiabled(): bool
public function disabled(): bool
{
return !$this->enable;
}
... ...
... ... @@ -6,5 +6,5 @@ interface AgentInterface
{
public function report(array $content);
public function dsiabled(): bool;
public function disabled(): bool;
}
... ...
... ... @@ -31,7 +31,7 @@ class ExceptionPush
*/
public static function getAgents($options = null): array
{
$agentOpts = $options ? : (array) static::config('agents');
$agentOpts = $options ?: (array)static::config('agents');
$agents = [];
... ...
... ... @@ -16,7 +16,7 @@ class ExceptionPushProvider extends ServiceProvider
public function boot()
{
if ($this->app->runningInConsole()) {
$configPath = __DIR__.'/../publish/exception.push.php';
$configPath = __DIR__ . '/../publish/exception.push.php';
$this->publishes([
$configPath => config_path('exception.push.php')
], 'lackoxygen-exception-push');
... ...
... ... @@ -15,12 +15,12 @@ class Formatter implements CallbackInterface
{
return function (Context $context) {
return [
'时间:'.Carbon::now()->toDateTimeString(), '环境:'.config('app.env'), '项目:'.config('app.name'),
'参数:'.json_encode($context->getInput()), 'runtime:'.php_sapi_name(), '地址:'.$context->getPath(),
'请求方法:'.$context->getMethod(), 'IP:'.$context->getIp(),
'异常:'.sprintf('%s(%s)(code:%d):at %s:%d', $context->getException(), $context->getMessage(),
'时间:' . Carbon::now()->toDateTimeString(), '环境:' . config('app.env'), '项目:' . config('app.name'),
'参数:' . json_encode($context->getInput()), 'runtime:' . php_sapi_name(), '地址:' . $context->getPath(),
'请求方法:' . $context->getMethod(), 'IP:' . $context->getIp(),
'异常:' . sprintf('%s(%s)(code:%d):at %s:%d', $context->getException(), $context->getMessage(),
$context->getCode(), $context->getFile(), $context->getLine()),
'trace:'.implode(PHP_EOL, $context->getTrace()),
'trace:' . implode(PHP_EOL, $context->getTrace()),
];
};
}
... ...
... ... @@ -43,7 +43,8 @@ class MonologHandler extends AbstractSyslogHandler
$facility = LOG_USER,
$level = Logger::DEBUG,
bool $bubble = true
) {
)
{
parent::__construct($facility, $level, $bubble);
$this->dispatcher = Dispatcher::callback();
... ...
... ... @@ -53,7 +53,7 @@ class Parser
$this->context->setException(get_class($this->throw));
$this->context->setMethod($this->request->getMethod());
$this->context->setPath($this->request->path());
$this->context->setCode((string) $this->throw->getCode());
$this->context->setCode((string)$this->throw->getCode());
$this->context->setFile($this->realpath($this->throw->getFile()));
$this->context->setLine($this->throw->getLine());
$this->context->setMessage($this->throw->getMessage());
... ...