| @@ -47,7 +47,7 @@ discard block | ||
| 47 | 47 | return static::$method(...$arguments); | 
| 48 | 48 | default: | 
| 49 | 49 | return static::getFacadeRoot() | 
| 50 | - ->$method(...$arguments); | |
| 50 | + ->$method(...$arguments); | |
| 51 | 51 | } | 
| 52 | 52 | } | 
| 53 | 53 | |
| @@ -63,7 +63,7 @@ discard block | ||
| 63 | 63 | Write::dispatch($parameters, $payload); | 
| 64 | 64 |          } else { | 
| 65 | 65 | return static::getFacadeRoot() | 
| 66 | - ->write($parameters, $payload); | |
| 66 | + ->write($parameters, $payload); | |
| 67 | 67 | } | 
| 68 | 68 | |
| 69 | 69 | return true; | 
| @@ -85,7 +85,7 @@ discard block | ||
| 85 | 85 | WritePayload::dispatch($payload, $precision, $retentionPolicy); | 
| 86 | 86 |          } else { | 
| 87 | 87 | return static::getFacadeRoot() | 
| 88 | - ->writePayload($payload, $precision, $retentionPolicy); | |
| 88 | + ->writePayload($payload, $precision, $retentionPolicy); | |
| 89 | 89 | } | 
| 90 | 90 | |
| 91 | 91 | return true; | 
| @@ -107,7 +107,7 @@ discard block | ||
| 107 | 107 | WritePoints::dispatch($points, $precision, $retentionPolicy); | 
| 108 | 108 |          } else { | 
| 109 | 109 | return static::getFacadeRoot() | 
| 110 | - ->writePoints($points, $precision, $retentionPolicy); | |
| 110 | + ->writePoints($points, $precision, $retentionPolicy); | |
| 111 | 111 | } | 
| 112 | 112 | |
| 113 | 113 | return true; | 
| @@ -76,8 +76,8 @@ discard block | ||
| 76 | 76 | */ | 
| 77 | 77 | public static function writePayload( | 
| 78 | 78 | $payload, | 
| 79 | - $precision = WritePayload::PRECISION_NANOSECONDS, | |
| 80 | - $retentionPolicy = null | |
| 79 | + $precision=WritePayload::PRECISION_NANOSECONDS, | |
| 80 | + $retentionPolicy=null | |
| 81 | 81 |      ): bool { | 
| 82 | 82 |          if (config('influxdb.queue.enable', false) === true) { | 
| 83 | 83 | WritePayload::dispatch($payload, $precision, $retentionPolicy); | 
| @@ -98,8 +98,8 @@ discard block | ||
| 98 | 98 | */ | 
| 99 | 99 | public static function writePoints( | 
| 100 | 100 | array $points, | 
| 101 | - $precision = WritePoints::PRECISION_NANOSECONDS, | |
| 102 | - $retentionPolicy = null | |
| 101 | + $precision=WritePoints::PRECISION_NANOSECONDS, | |
| 102 | + $retentionPolicy=null | |
| 103 | 103 |      ): bool { | 
| 104 | 104 |          if (config('influxdb.queue.enable', false) === true) { | 
| 105 | 105 | WritePoints::dispatch($points, $precision, $retentionPolicy); | 
| @@ -91,10 +91,10 @@ | ||
| 91 | 91 | public function handle() | 
| 92 | 92 |      { | 
| 93 | 93 | InfluxDbServiceProvider::getInstance() | 
| 94 | - ->writePayload( | |
| 95 | - $this->payload, | |
| 96 | - $this->precision, | |
| 97 | - $this->retentionPolicy | |
| 98 | - ); | |
| 94 | + ->writePayload( | |
| 95 | + $this->payload, | |
| 96 | + $this->precision, | |
| 97 | + $this->retentionPolicy | |
| 98 | + ); | |
| 99 | 99 | } | 
| 100 | 100 | } | 
| @@ -19,47 +19,47 @@ discard block | ||
| 19 | 19 | /** | 
| 20 | 20 | * @var string PRECISION_NANOSECONDS | 
| 21 | 21 | */ | 
| 22 | - const PRECISION_NANOSECONDS = 'n'; | |
| 22 | + const PRECISION_NANOSECONDS='n'; | |
| 23 | 23 | |
| 24 | 24 | /** | 
| 25 | 25 | * @var string PRECISION_MICROSECONDS | 
| 26 | 26 | */ | 
| 27 | - const PRECISION_MICROSECONDS = 'u'; | |
| 27 | + const PRECISION_MICROSECONDS='u'; | |
| 28 | 28 | |
| 29 | 29 | /** | 
| 30 | 30 | * @var string PRECISION_MILLISECONDS | 
| 31 | 31 | */ | 
| 32 | - const PRECISION_MILLISECONDS = 'ms'; | |
| 32 | + const PRECISION_MILLISECONDS='ms'; | |
| 33 | 33 | |
| 34 | 34 | /** | 
| 35 | 35 | * @var string PRECISION_SECONDS | 
| 36 | 36 | */ | 
| 37 | - const PRECISION_SECONDS = 's'; | |
| 37 | + const PRECISION_SECONDS='s'; | |
| 38 | 38 | |
| 39 | 39 | /** | 
| 40 | 40 | * @var string PRECISION_MINUTES | 
| 41 | 41 | */ | 
| 42 | - const PRECISION_MINUTES = 'm'; | |
| 42 | + const PRECISION_MINUTES='m'; | |
| 43 | 43 | |
| 44 | 44 | /** | 
| 45 | 45 | * @var string PRECISION_HOURS | 
| 46 | 46 | */ | 
| 47 | - const PRECISION_HOURS = 'h'; | |
| 47 | + const PRECISION_HOURS='h'; | |
| 48 | 48 | |
| 49 | 49 | /** | 
| 50 | 50 | * @var string|array | 
| 51 | 51 | */ | 
| 52 | - public $payload = null; | |
| 52 | + public $payload=null; | |
| 53 | 53 | |
| 54 | 54 | /** | 
| 55 | 55 | * @var string | 
| 56 | 56 | */ | 
| 57 | - public $precision = null; | |
| 57 | + public $precision=null; | |
| 58 | 58 | |
| 59 | 59 | /** | 
| 60 | 60 | * @var string|null | 
| 61 | 61 | */ | 
| 62 | - public $retentionPolicy = null; | |
| 62 | + public $retentionPolicy=null; | |
| 63 | 63 | |
| 64 | 64 | /** | 
| 65 | 65 | * WritePayload constructor. | 
| @@ -68,11 +68,11 @@ discard block | ||
| 68 | 68 | * @param string $precision | 
| 69 | 69 | * @param string|null $retentionPolicy | 
| 70 | 70 | */ | 
| 71 | - public function __construct($payload, $precision = self::PRECISION_NANOSECONDS, $retentionPolicy = null) | |
| 71 | + public function __construct($payload, $precision=self::PRECISION_NANOSECONDS, $retentionPolicy=null) | |
| 72 | 72 |      { | 
| 73 | - $this->payload = $payload; | |
| 74 | - $this->precision = $precision; | |
| 75 | - $this->retentionPolicy = $retentionPolicy; | |
| 73 | + $this->payload=$payload; | |
| 74 | + $this->precision=$precision; | |
| 75 | + $this->retentionPolicy=$retentionPolicy; | |
| 76 | 76 | |
| 77 | 77 | parent::__construct( | 
| 78 | 78 | [ | 
| @@ -53,9 +53,9 @@ | ||
| 53 | 53 | public function handle() | 
| 54 | 54 |      { | 
| 55 | 55 | InfluxDbServiceProvider::getInstance() | 
| 56 | - ->write( | |
| 57 | - $this->parameters, | |
| 58 | - $this->payload | |
| 59 | - ); | |
| 56 | + ->write( | |
| 57 | + $this->parameters, | |
| 58 | + $this->payload | |
| 59 | + ); | |
| 60 | 60 | } | 
| 61 | 61 | } | 
| @@ -19,12 +19,12 @@ discard block | ||
| 19 | 19 | /** | 
| 20 | 20 | * @var string|array | 
| 21 | 21 | */ | 
| 22 | - public $payload = null; | |
| 22 | + public $payload=null; | |
| 23 | 23 | |
| 24 | 24 | /** | 
| 25 | 25 | * @var array | 
| 26 | 26 | */ | 
| 27 | - public $parameters = null; | |
| 27 | + public $parameters=null; | |
| 28 | 28 | |
| 29 | 29 | /** | 
| 30 | 30 | * Write constructor. | 
| @@ -34,8 +34,8 @@ discard block | ||
| 34 | 34 | */ | 
| 35 | 35 | public function __construct(array $parameters, $payload) | 
| 36 | 36 |      { | 
| 37 | - $this->parameters = $parameters; | |
| 38 | - $this->payload = $payload; | |
| 37 | + $this->parameters=$parameters; | |
| 38 | + $this->payload=$payload; | |
| 39 | 39 | |
| 40 | 40 | parent::__construct( | 
| 41 | 41 | [ | 
| @@ -91,10 +91,10 @@ | ||
| 91 | 91 | public function handle() | 
| 92 | 92 |      { | 
| 93 | 93 | InfluxDbServiceProvider::getInstance() | 
| 94 | - ->writePoints( | |
| 95 | - $this->points, | |
| 96 | - $this->precision, | |
| 97 | - $this->retentionPolicy | |
| 98 | - ); | |
| 94 | + ->writePoints( | |
| 95 | + $this->points, | |
| 96 | + $this->precision, | |
| 97 | + $this->retentionPolicy | |
| 98 | + ); | |
| 99 | 99 | } | 
| 100 | 100 | } | 
| @@ -19,47 +19,47 @@ discard block | ||
| 19 | 19 | /** | 
| 20 | 20 | * @var string PRECISION_NANOSECONDS | 
| 21 | 21 | */ | 
| 22 | - const PRECISION_NANOSECONDS = 'n'; | |
| 22 | + const PRECISION_NANOSECONDS='n'; | |
| 23 | 23 | |
| 24 | 24 | /** | 
| 25 | 25 | * @var string PRECISION_MICROSECONDS | 
| 26 | 26 | */ | 
| 27 | - const PRECISION_MICROSECONDS = 'u'; | |
| 27 | + const PRECISION_MICROSECONDS='u'; | |
| 28 | 28 | |
| 29 | 29 | /** | 
| 30 | 30 | * @var string PRECISION_MILLISECONDS | 
| 31 | 31 | */ | 
| 32 | - const PRECISION_MILLISECONDS = 'ms'; | |
| 32 | + const PRECISION_MILLISECONDS='ms'; | |
| 33 | 33 | |
| 34 | 34 | /** | 
| 35 | 35 | * @var string PRECISION_SECONDS | 
| 36 | 36 | */ | 
| 37 | - const PRECISION_SECONDS = 's'; | |
| 37 | + const PRECISION_SECONDS='s'; | |
| 38 | 38 | |
| 39 | 39 | /** | 
| 40 | 40 | * @var string PRECISION_MINUTES | 
| 41 | 41 | */ | 
| 42 | - const PRECISION_MINUTES = 'm'; | |
| 42 | + const PRECISION_MINUTES='m'; | |
| 43 | 43 | |
| 44 | 44 | /** | 
| 45 | 45 | * @var string PRECISION_HOURS | 
| 46 | 46 | */ | 
| 47 | - const PRECISION_HOURS = 'h'; | |
| 47 | + const PRECISION_HOURS='h'; | |
| 48 | 48 | |
| 49 | 49 | /** | 
| 50 | 50 | * @var array | 
| 51 | 51 | */ | 
| 52 | - public $points = null; | |
| 52 | + public $points=null; | |
| 53 | 53 | |
| 54 | 54 | /** | 
| 55 | 55 | * @var string | 
| 56 | 56 | */ | 
| 57 | - public $precision = null; | |
| 57 | + public $precision=null; | |
| 58 | 58 | |
| 59 | 59 | /** | 
| 60 | 60 | * @var string|null | 
| 61 | 61 | */ | 
| 62 | - public $retentionPolicy = null; | |
| 62 | + public $retentionPolicy=null; | |
| 63 | 63 | |
| 64 | 64 | /** | 
| 65 | 65 | * WritePoints constructor. | 
| @@ -68,11 +68,11 @@ discard block | ||
| 68 | 68 | * @param string $precision | 
| 69 | 69 | * @param string|null $retentionPolicy | 
| 70 | 70 | */ | 
| 71 | - public function __construct(array $points, $precision = self::PRECISION_NANOSECONDS, $retentionPolicy = null) | |
| 71 | + public function __construct(array $points, $precision=self::PRECISION_NANOSECONDS, $retentionPolicy=null) | |
| 72 | 72 |      { | 
| 73 | - $this->points = $points; | |
| 74 | - $this->precision = $precision; | |
| 75 | - $this->retentionPolicy = $retentionPolicy; | |
| 73 | + $this->points=$points; | |
| 74 | + $this->precision=$precision; | |
| 75 | + $this->retentionPolicy=$retentionPolicy; | |
| 76 | 76 | |
| 77 | 77 | parent::__construct( | 
| 78 | 78 | [ | 
| @@ -41,10 +41,10 @@ | ||
| 41 | 41 | * | 
| 42 | 42 | * @param array $args | 
| 43 | 43 | */ | 
| 44 | - public function __construct(array $args = []) | |
| 44 | + public function __construct(array $args=[ ]) | |
| 45 | 45 |      { | 
| 46 | 46 |          if (count($args)) { | 
| 47 | - $this->args = $args; | |
| 47 | + $this->args=$args; | |
| 48 | 48 | } | 
| 49 | 49 | } | 
| 50 | 50 | } | 
| @@ -23,7 +23,7 @@ | ||
| 23 | 23 | * @param int $level | 
| 24 | 24 | * @param bool $bubble | 
| 25 | 25 | */ | 
| 26 | - public function __construct($level = Logger::DEBUG, $bubble = true) | |
| 26 | + public function __construct($level=Logger::DEBUG, $bubble=true) | |
| 27 | 27 |      { | 
| 28 | 28 | parent::__construct($level, $bubble); | 
| 29 | 29 | } | 
| @@ -29,8 +29,8 @@ discard block | ||
| 29 | 29 | public function boot(): void | 
| 30 | 30 |      { | 
| 31 | 31 | $this->publishes([ | 
| 32 | -                             __DIR__.'/config/influxdb.php' => config_path('influxdb.php'), | |
| 33 | - ]); | |
| 32 | +                                __DIR__.'/config/influxdb.php' => config_path('influxdb.php'), | |
| 33 | + ]); | |
| 34 | 34 | |
| 35 | 35 | $this->mergeConfigFrom(__DIR__.'/config/influxdb.php', 'influxdb'); | 
| 36 | 36 | |
| @@ -62,12 +62,12 @@ discard block | ||
| 62 | 62 | } | 
| 63 | 63 | |
| 64 | 64 |                  $dsn = sprintf('%s://%s:%s@%s:%s/%s', | 
| 65 | - $protocol, | |
| 66 | -                               config('influxdb.user'), | |
| 67 | -                               config('influxdb.pass'), | |
| 68 | -                               config('influxdb.host'), | |
| 69 | -                               config('influxdb.port'), | |
| 70 | -                               config('influxdb.database') | |
| 65 | + $protocol, | |
| 66 | +                                config('influxdb.user'), | |
| 67 | +                                config('influxdb.pass'), | |
| 68 | +                                config('influxdb.host'), | |
| 69 | +                                config('influxdb.port'), | |
| 70 | +                                config('influxdb.database') | |
| 71 | 71 | ); | 
| 72 | 72 | |
| 73 | 73 | return InfluxClient::fromDSN($dsn, $timeout, $verifySsl); | 
| @@ -29,19 +29,19 @@ discard block | ||
| 29 | 29 | public function boot(): void | 
| 30 | 30 |      { | 
| 31 | 31 | $this->publishes([ | 
| 32 | -                             __DIR__.'/config/influxdb.php' => config_path('influxdb.php'), | |
| 32 | +                             __DIR__ . '/config/influxdb.php' => config_path('influxdb.php'), | |
| 33 | 33 | ]); | 
| 34 | 34 | |
| 35 | - $this->mergeConfigFrom(__DIR__.'/config/influxdb.php', 'influxdb'); | |
| 35 | + $this->mergeConfigFrom(__DIR__ . '/config/influxdb.php', 'influxdb'); | |
| 36 | 36 | |
| 37 | 37 |          if (config('influxdb.log.monolog', false) === true) { | 
| 38 | - $handler = new MonologHandler($this->getLoggingLevel()); | |
| 38 | + $handler=new MonologHandler($this->getLoggingLevel()); | |
| 39 | 39 | $handler->setFormatter(new Formatter()); | 
| 40 | 40 | |
| 41 | - $monolog = Log::getMonolog(); | |
| 41 | + $monolog=Log::getMonolog(); | |
| 42 | 42 | $monolog->pushHandler($handler); | 
| 43 | 43 | |
| 44 | - $new_log = new Writer($monolog, Log::getEventDispatcher()); | |
| 44 | + $new_log=new Writer($monolog, Log::getEventDispatcher()); | |
| 45 | 45 | Log::swap($new_log); | 
| 46 | 46 | } | 
| 47 | 47 | } | 
| @@ -51,17 +51,17 @@ discard block | ||
| 51 | 51 | */ | 
| 52 | 52 | public function register(): void | 
| 53 | 53 |      { | 
| 54 | -        $this->app->singleton('InfluxDb', function ($app) { | |
| 54 | +        $this->app->singleton('InfluxDb', function($app) { | |
| 55 | 55 |              try { | 
| 56 | -                $timeout = is_int(config('influxdb.timeout', null)) ? config('influxdb.timeout') : 5; | |
| 57 | -                $verifySsl = is_bool(config('influxdb.verify_ssl', null)) ? config('influxdb.verify_ssl') : true; | |
| 58 | - $protocol = 'influxdb'; | |
| 56 | +                $timeout=is_int(config('influxdb.timeout', null)) ? config('influxdb.timeout') : 5; | |
| 57 | +                $verifySsl=is_bool(config('influxdb.verify_ssl', null)) ? config('influxdb.verify_ssl') : true; | |
| 58 | + $protocol='influxdb'; | |
| 59 | 59 | |
| 60 | -                if (in_array(config('influxdb.protocol'), ['https', 'udp'])) { | |
| 61 | -                    $protocol = config('influxdb.protocol').'+'.$protocol; | |
| 60 | +                if (in_array(config('influxdb.protocol'), [ 'https', 'udp' ])) { | |
| 61 | +                    $protocol=config('influxdb.protocol') . '+' . $protocol; | |
| 62 | 62 | } | 
| 63 | 63 | |
| 64 | -                $dsn = sprintf('%s://%s:%s@%s:%s/%s', | |
| 64 | +                $dsn=sprintf('%s://%s:%s@%s:%s/%s', | |
| 65 | 65 | $protocol, | 
| 66 | 66 |                                 config('influxdb.user'), | 
| 67 | 67 |                                 config('influxdb.pass'), | 
| @@ -82,8 +82,8 @@ discard block | ||
| 82 | 82 | */ | 
| 83 | 83 | private function getLoggingLevel() | 
| 84 | 84 |      { | 
| 85 | -        $level = config('influxdb.log.level', 'DEBUG'); | |
| 86 | - $level = empty($level) ? 'DEBUG' : $level; | |
| 85 | +        $level=config('influxdb.log.level', 'DEBUG'); | |
| 86 | + $level=empty($level) ? 'DEBUG' : $level; | |
| 87 | 87 | |
| 88 | 88 | return in_array($level, [ | 
| 89 | 89 | 'DEBUG', | 
| @@ -7,7 +7,7 @@ | ||
| 7 | 7 | */ | 
| 8 | 8 | declare(strict_types=1); | 
| 9 | 9 | |
| 10 | -if (! function_exists('influxdb')) { | |
| 10 | +if (!function_exists('influxdb')) { | |
| 11 | 11 | /** | 
| 12 | 12 | * @return \InfluxDB\Client|\InfluxDB\Database | 
| 13 | 13 | */ | 
| @@ -21,9 +21,9 @@ discard block | ||
| 21 | 21 | */ | 
| 22 | 22 | public function format(array $record) | 
| 23 | 23 |      { | 
| 24 | - $record = parent::format($record); | |
| 24 | + $record=parent::format($record); | |
| 25 | 25 | |
| 26 | - $message = $this->prepareMessage($record); | |
| 26 | + $message=$this->prepareMessage($record); | |
| 27 | 27 | |
| 28 | 28 | return $message; | 
| 29 | 29 | } | 
| @@ -35,44 +35,44 @@ discard block | ||
| 35 | 35 | */ | 
| 36 | 36 | protected function prepareMessage(array $record): array | 
| 37 | 37 |      { | 
| 38 | - $tags = []; | |
| 39 | - $message = []; | |
| 40 | - $message['name'] = 'Error'; | |
| 41 | - $message['value'] = 1; | |
| 42 | -        $message['timestamp'] = exec('date +%s%N'); | |
| 43 | - | |
| 44 | -        if (isset($_SERVER['REMOTE_ADDR'])) { | |
| 45 | - $tags['serverName'] = $_SERVER['REMOTE_ADDR']; | |
| 38 | + $tags=[ ]; | |
| 39 | + $message=[ ]; | |
| 40 | + $message[ 'name' ]='Error'; | |
| 41 | + $message[ 'value' ]=1; | |
| 42 | +        $message[ 'timestamp' ]=exec('date +%s%N'); | |
| 43 | + | |
| 44 | +        if (isset($_SERVER[ 'REMOTE_ADDR' ])) { | |
| 45 | + $tags[ 'serverName' ]=$_SERVER[ 'REMOTE_ADDR' ]; | |
| 46 | 46 | } | 
| 47 | 47 | |
| 48 | -        if (isset($record['level'])) { | |
| 49 | - $tags['severity'] = $this->rfc5424ToSeverity($record['level']); | |
| 48 | +        if (isset($record[ 'level' ])) { | |
| 49 | + $tags[ 'severity' ]=$this->rfc5424ToSeverity($record[ 'level' ]); | |
| 50 | 50 | } | 
| 51 | 51 | |
| 52 | -        if (isset($_SERVER['REQUEST_URI'])) { | |
| 53 | - $tags['endpoint_url'] = $_SERVER['REQUEST_URI']; | |
| 52 | +        if (isset($_SERVER[ 'REQUEST_URI' ])) { | |
| 53 | + $tags[ 'endpoint_url' ]=$_SERVER[ 'REQUEST_URI' ]; | |
| 54 | 54 | } | 
| 55 | 55 | |
| 56 | -        if (isset($_SERVER['REQUEST_METHOD'])) { | |
| 57 | - $tags['method'] = $_SERVER['REQUEST_METHOD']; | |
| 56 | +        if (isset($_SERVER[ 'REQUEST_METHOD' ])) { | |
| 57 | + $tags[ 'method' ]=$_SERVER[ 'REQUEST_METHOD' ]; | |
| 58 | 58 | } | 
| 59 | 59 | |
| 60 | -        if (isset($record['context']['user_id'])) { | |
| 61 | - $tags['user_id'] = $record['context']['user_id']; | |
| 60 | +        if (isset($record[ 'context' ][ 'user_id' ])) { | |
| 61 | + $tags[ 'user_id' ]=$record[ 'context' ][ 'user_id' ]; | |
| 62 | 62 | } | 
| 63 | 63 | |
| 64 | -        if (isset($record['context']['project_id'])) { | |
| 65 | - $tags['project_id'] = $record['context']['project_id']; | |
| 64 | +        if (isset($record[ 'context' ][ 'project_id' ])) { | |
| 65 | + $tags[ 'project_id' ]=$record[ 'context' ][ 'project_id' ]; | |
| 66 | 66 | } | 
| 67 | 67 | |
| 68 | -        if (isset($record['context']['file'])) { | |
| 69 | - $tags['file'] = $this->replaceDigitData($record['context']['file']); | |
| 68 | +        if (isset($record[ 'context' ][ 'file' ])) { | |
| 69 | + $tags[ 'file' ]=$this->replaceDigitData($record[ 'context' ][ 'file' ]); | |
| 70 | 70 | } | 
| 71 | 71 | |
| 72 | -        if (isset($record['context']['event']['api_stats'][0])) { | |
| 73 | -            foreach ($record['context']['event']['api_stats'][0] as $k => $v) { | |
| 72 | +        if (isset($record[ 'context' ][ 'event' ][ 'api_stats' ][ 0 ])) { | |
| 73 | +            foreach ($record[ 'context' ][ 'event' ][ 'api_stats' ][ 0 ] as $k => $v) { | |
| 74 | 74 |                  if (is_string($v) || is_int($v)) { | 
| 75 | - $tags[$k] = $v; | |
| 75 | + $tags[ $k ]=$v; | |
| 76 | 76 | } | 
| 77 | 77 | } | 
| 78 | 78 | } | 
| @@ -80,15 +80,15 @@ discard block | ||
| 80 | 80 |          if (isset($tags) && count($tags)) { | 
| 81 | 81 |              foreach ($tags as $k => $v) { | 
| 82 | 82 |                  if (is_numeric($v)) { | 
| 83 | - $message['fields'][$k] = (int) $v; | |
| 83 | + $message[ 'fields' ][ $k ]=(int) $v; | |
| 84 | 84 | } | 
| 85 | 85 | } | 
| 86 | 86 | |
| 87 | - $message['tags'] = $tags; | |
| 87 | + $message[ 'tags' ]=$tags; | |
| 88 | 88 | } | 
| 89 | 89 | |
| 90 | -        if (isset($message['fields']['Debug']['message'])) { | |
| 91 | - $message['fields']['Debug']['message'] = $this->trimLines($message['fields']['Debug']['message']); | |
| 90 | +        if (isset($message[ 'fields' ][ 'Debug' ][ 'message' ])) { | |
| 91 | + $message[ 'fields' ][ 'Debug' ][ 'message' ]=$this->trimLines($message[ 'fields' ][ 'Debug' ][ 'message' ]); | |
| 92 | 92 | } | 
| 93 | 93 | |
| 94 | 94 | return $message; | 
| @@ -101,7 +101,7 @@ discard block | ||
| 101 | 101 | */ | 
| 102 | 102 | private function rfc5424ToSeverity(int $level) | 
| 103 | 103 |      { | 
| 104 | - $levels = [ | |
| 104 | + $levels=[ | |
| 105 | 105 | 100 => 'Debugging', | 
| 106 | 106 | 200 => 'Informational', | 
| 107 | 107 | 250 => 'Notice', | 
| @@ -112,7 +112,7 @@ discard block | ||
| 112 | 112 | 600 => 'Emergency', | 
| 113 | 113 | ]; | 
| 114 | 114 | |
| 115 | - $result = isset($levels[$level]) ? $levels[$level] : $levels[600]; | |
| 115 | + $result=isset($levels[ $level ]) ? $levels[ $level ] : $levels[ 600 ]; | |
| 116 | 116 | |
| 117 | 117 | return $result; | 
| 118 | 118 | } | 
| @@ -124,8 +124,8 @@ discard block | ||
| 124 | 124 | */ | 
| 125 | 125 | private function replaceDigitData(string $string): string | 
| 126 | 126 |      { | 
| 127 | -        $string = preg_replace('~\/[0-9]+~', '/*', $string); | |
| 128 | -        $string = preg_replace('~\=[0-9]+~', '=*', $string); | |
| 127 | +        $string=preg_replace('~\/[0-9]+~', '/*', $string); | |
| 128 | +        $string=preg_replace('~\=[0-9]+~', '=*', $string); | |
| 129 | 129 | |
| 130 | 130 | return $string; | 
| 131 | 131 | } | 
| @@ -137,13 +137,13 @@ discard block | ||
| 137 | 137 | */ | 
| 138 | 138 | private function trimLines($message): string | 
| 139 | 139 |      { | 
| 140 | -        $limit = config('influxdb.log.limit'); | |
| 140 | +        $limit=config('influxdb.log.limit'); | |
| 141 | 141 | |
| 142 | 142 |          if ($limit) { | 
| 143 | - $message_array = explode(PHP_EOL, $message); | |
| 143 | + $message_array=explode(PHP_EOL, $message); | |
| 144 | 144 | |
| 145 | 145 |              if ($limit < count($message_array)) { | 
| 146 | - $message = implode(PHP_EOL, array_slice($message_array, 0, $limit)); | |
| 146 | + $message=implode(PHP_EOL, array_slice($message_array, 0, $limit)); | |
| 147 | 147 | } | 
| 148 | 148 | } | 
| 149 | 149 | |