Completed
Pull Request — master (#14)
by Sergey
03:24
created
src/LaravelDatadogHelperServiceProvider.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,16 +47,16 @@  discard block
 block discarded – undo
47 47
         $laravelConfig = config('datadog-helper');
48 48
 
49 49
         $ddConfig = [
50
-            'host' => $laravelConfig['statsd_server'],
51
-            'port' => $laravelConfig['statsd_port'],
52
-            'datadog_host' => $laravelConfig['datadog_host'],
53
-            'api_key' => $laravelConfig['api_key'],
54
-            'app_key' => $laravelConfig['application_key'],
55
-            'global_tags' => $laravelConfig['global_tags'],
50
+            'host' => $laravelConfig[ 'statsd_server' ],
51
+            'port' => $laravelConfig[ 'statsd_port' ],
52
+            'datadog_host' => $laravelConfig[ 'datadog_host' ],
53
+            'api_key' => $laravelConfig[ 'api_key' ],
54
+            'app_key' => $laravelConfig[ 'application_key' ],
55
+            'global_tags' => $laravelConfig[ 'global_tags' ],
56 56
         ];
57 57
 
58
-        $maxBuffer = $laravelConfig['max_buffer_length'];
59
-        if($maxBuffer > 1) {
58
+        $maxBuffer = $laravelConfig[ 'max_buffer_length' ];
59
+        if ($maxBuffer > 1) {
60 60
             $datadog = new BatchedDogStatsd($ddConfig);
61 61
             $datadog::$maxBufferLength = $maxBuffer;
62 62
         }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             $datadog = new DogStatsd($ddConfig);
65 65
         }
66 66
 
67
-        $datadog->setMetricsPrefix($laravelConfig['prefix']);
67
+        $datadog->setMetricsPrefix($laravelConfig[ 'prefix' ]);
68 68
 
69 69
         return $datadog;
70 70
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@
 block discarded – undo
59 59
         if($maxBuffer > 1) {
60 60
             $datadog = new BatchedDogStatsd($ddConfig);
61 61
             $datadog::$maxBufferLength = $maxBuffer;
62
-        }
63
-        else {
62
+        } else {
64 63
             $datadog = new DogStatsd($ddConfig);
65 64
         }
66 65
 
Please login to merge, or discard this patch.
src/Datadog/ExtensionTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@
 block discarded – undo
11 11
 
12 12
     protected function wrapSendDataWithMetricPrefix($data)
13 13
     {
14
-        if(!$this->metricsPrefix) {
14
+        if (!$this->metricsPrefix) {
15 15
             return $data;
16 16
         }
17 17
 
18
-        $wrapped = [];
19
-        foreach($data as $metric => $stat) {
20
-            $wrapped[$this->metricsPrefix . '.'. $metric] = $stat;
18
+        $wrapped = [ ];
19
+        foreach ($data as $metric => $stat) {
20
+            $wrapped[ $this->metricsPrefix . '.' . $metric ] = $stat;
21 21
         }
22 22
         return $wrapped;
23 23
     }
Please login to merge, or discard this patch.
config/datadog-helper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
     'statsd_port' => 8125,
36 36
 
37
-    'global_tags' => [],
37
+    'global_tags' => [ ],
38 38
 
39 39
     'max_buffer_length' => 1,
40 40
 
Please login to merge, or discard this patch.