作者 竞泽

style:format

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