| @@ -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; | 
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 8 | +declare(strict_types = 1); | |
| 9 | 9 | |
| 10 | 10 | namespace AustinHeap\Database\InfluxDb; | 
| 11 | 11 | |
| @@ -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 | } | 
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 8 | +declare(strict_types = 1); | |
| 9 | 9 | |
| 10 | 10 | namespace AustinHeap\Database\InfluxDb\Jobs; | 
| 11 | 11 | |
| @@ -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 | } | 
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 8 | +declare(strict_types = 1); | |
| 9 | 9 | |
| 10 | 10 | namespace AustinHeap\Database\InfluxDb\Jobs; | 
| 11 | 11 | |
| @@ -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 | } | 
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 8 | +declare(strict_types = 1); | |
| 9 | 9 | |
| 10 | 10 | namespace AustinHeap\Database\InfluxDb\Jobs; | 
| 11 | 11 | |
| @@ -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); | 
| @@ -5,7 +5,7 @@ discard block | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 8 | +declare(strict_types = 1); | |
| 9 | 9 | |
| 10 | 10 | namespace AustinHeap\Database\InfluxDb; | 
| 11 | 11 | |
| @@ -29,10 +29,10 @@ 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 | 38 | $handler = new MonologHandler($this->getLoggingLevel()); | 
| @@ -51,14 +51,14 @@ 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 | 56 |                  $timeout = is_int(config('influxdb.timeout', null)) ? config('influxdb.timeout') : 5; | 
| 57 | 57 |                  $verifySsl = is_bool(config('influxdb.verify_ssl', null)) ? config('influxdb.verify_ssl') : true; | 
| 58 | 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 | 64 |                  $dsn = sprintf('%s://%s:%s@%s:%s/%s', | 
| @@ -5,7 +5,7 @@ discard block | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 8 | +declare(strict_types = 1); | |
| 9 | 9 | |
| 10 | 10 | namespace AustinHeap\Database\InfluxDb\Logs; | 
| 11 | 11 | |
| @@ -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; | 
| @@ -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 | } | 
| @@ -5,7 +5,7 @@ | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 8 | +declare(strict_types = 1); | |
| 9 | 9 | |
| 10 | 10 | namespace AustinHeap\Database\InfluxDb\Logs; | 
| 11 | 11 | |
| @@ -5,7 +5,7 @@ discard block | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 8 | +declare(strict_types = 1); | |
| 9 | 9 | |
| 10 | 10 | namespace AustinHeap\Database\InfluxDb\Jobs; | 
| 11 | 11 | |
| @@ -35,7 +35,7 @@ discard block | ||
| 35 | 35 | * | 
| 36 | 36 | * @param array $args | 
| 37 | 37 | */ | 
| 38 | - public function __construct(array $args = []) | |
| 38 | + public function __construct(array $args = [ ]) | |
| 39 | 39 |      { | 
| 40 | 40 |          if (count($args)) { | 
| 41 | 41 | $this->args = $args; | 
| @@ -5,9 +5,9 @@ | ||
| 5 | 5 | * @author Austin Heap <[email protected]> | 
| 6 | 6 | * @version v0.1.5 | 
| 7 | 7 | */ | 
| 8 | -declare(strict_types=1); | |
| 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 | */ |