Passed
Push — master ( 470edb...8eeeda )
by Austin
01:51
created
src/Logs/Formatter.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Logs/MonologHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Jobs/Write.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Jobs/WritePayload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Jobs/Job.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
src/Jobs/WritePoints.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/InfluxDbServiceProvider.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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',
Please login to merge, or discard this patch.
src/helpers.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
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
      */
Please login to merge, or discard this patch.
src/InfluxDbFacade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.