Completed
Push — master ( 23ca50...fa2c41 )
by Paras
9s
created
src/FrequencyDistributionExpressionFactory.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -7,26 +7,26 @@
 block discarded – undo
7 7
 
8 8
 class FrequencyDistributionExpressionFactory
9 9
 {
10
-	/**
11
-	 * Create a new trend expression instance.
12
-	 *
13
-	 * @param \Illuminate\Database\Eloquent\Builder $query
14
-	 * @param string                                $column
15
-	 * @param int                                   $stepSize
16
-	 *
17
-	 * @return \Laravel\Nova\Metrics\FrequencyDistributionExpression
18
-	 */
19
-	public static function make(Builder $query, $column, $stepSize)
20
-	{
21
-		switch ($query->getConnection()->getDriverName()) {
22
-			case 'sqlite':
23
-				return new SqliteFrequencyDistributionExpression($query, $column, $stepSize);
24
-			case 'mysql':
25
-				return new MySqlFrequencyDistributionExpression($query, $column, $stepSize);
26
-			case 'pgsql':
27
-				return new PostgresFrequencyDistributionExpression($query, $column, $stepSize);
28
-			default:
29
-				throw new InvalidArgumentException('Bar chart metric helpers are not supported for this database.');
30
-		}
31
-	}
10
+    /**
11
+     * Create a new trend expression instance.
12
+     *
13
+     * @param \Illuminate\Database\Eloquent\Builder $query
14
+     * @param string                                $column
15
+     * @param int                                   $stepSize
16
+     *
17
+     * @return \Laravel\Nova\Metrics\FrequencyDistributionExpression
18
+     */
19
+    public static function make(Builder $query, $column, $stepSize)
20
+    {
21
+        switch ($query->getConnection()->getDriverName()) {
22
+            case 'sqlite':
23
+                return new SqliteFrequencyDistributionExpression($query, $column, $stepSize);
24
+            case 'mysql':
25
+                return new MySqlFrequencyDistributionExpression($query, $column, $stepSize);
26
+            case 'pgsql':
27
+                return new PostgresFrequencyDistributionExpression($query, $column, $stepSize);
28
+            default:
29
+                throw new InvalidArgumentException('Bar chart metric helpers are not supported for this database.');
30
+        }
31
+    }
32 32
 }
Please login to merge, or discard this patch.
src/BarChartMetric.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -6,24 +6,24 @@
 block discarded – undo
6 6
 
7 7
 abstract class BarChartMetric extends Partition
8 8
 {
9
-	use HasFrequencyDistributions;
9
+    use HasFrequencyDistributions;
10 10
 
11
-	/**
12
-	 * The element's component.
13
-	 *
14
-	 * @var string
15
-	 */
16
-	public $component = 'bar-chart-metric';
11
+    /**
12
+     * The element's component.
13
+     *
14
+     * @var string
15
+     */
16
+    public $component = 'bar-chart-metric';
17 17
 
18
-	/**
19
-	 * Create a new partition metric result.
20
-	 *
21
-	 * @param array $value
22
-	 *
23
-	 * @return \Insenseanalytics\NovaBarMetrics\BarChartMetricResult
24
-	 */
25
-	public function result(array $value)
26
-	{
27
-		return new BarChartMetricResult($value);
28
-	}
18
+    /**
19
+     * Create a new partition metric result.
20
+     *
21
+     * @param array $value
22
+     *
23
+     * @return \Insenseanalytics\NovaBarMetrics\BarChartMetricResult
24
+     */
25
+    public function result(array $value)
26
+    {
27
+        return new BarChartMetricResult($value);
28
+    }
29 29
 }
Please login to merge, or discard this patch.
src/BarChartMetricResult.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     public function jsonSerialize()
114 114
     {
115 115
         return [
116
-            'value' => collect($this->value ?? [])->map(function ($value, $label) {
116
+            'value' => collect($this->value ?? [])->map(function($value, $label) {
117 117
                 return ['label' => $label, 'value' => $value];
118 118
             })->values()->all(),
119 119
             'prefix' => $this->prefix,
@@ -136,8 +136,7 @@  discard block
 block discarded – undo
136 136
             if (2 == count($labelParts)) {
137 137
                 $newLabel = $this->formatStrNumber($labelParts[0], $labelPrecision) . ' - ' .
138 138
                     $this->formatStrNumber($labelParts[1], $labelPrecision);
139
-                $newData[$newLabel] = isset($newData[$newLabel]) ? ($value + $newData[$newLabel]) :
140
-                    $value;
139
+                $newData[$newLabel] = isset($newData[$newLabel]) ? ($value + $newData[$newLabel]) : $value;
141 140
             }
142 141
         }
143 142
 
Please login to merge, or discard this patch.
src/HasFrequencyDistributions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             ->orderBy('minval', 'asc')
45 45
             ->get();
46 46
 
47
-        return $this->result($results->mapWithKeys(function ($result) use ($column) {
47
+        return $this->result($results->mapWithKeys(function($result) use ($column) {
48 48
             return $this->formatAggregateResult($result, 'rng');
49 49
         })->all());
50 50
     }
Please login to merge, or discard this patch.
src/NovaBarMetricsServiceProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	 */
14 14
 	public function boot()
15 15
 	{
16
-		Nova::serving(function (ServingNova $event) {
16
+		Nova::serving(function(ServingNova $event) {
17 17
 			Nova::script('nova-bar-metrics', __DIR__ . '/../dist/js/nova-bar-metrics.js');
18 18
 			// Nova::style('nova-bar-metrics', __DIR__ . '/../dist/css/nova-bar-metrics.css');
19 19
 		});
Please login to merge, or discard this patch.
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -9,37 +9,37 @@
 block discarded – undo
9 9
 
10 10
 class NovaBarMetricsServiceProvider extends ServiceProvider
11 11
 {
12
-	/**
13
-	 * Bootstrap any application services.
14
-	 */
15
-	public function boot()
16
-	{
17
-		Nova::serving(function (ServingNova $event) {
18
-			Nova::script('nova-bar-metrics', __DIR__ . '/../dist/js/nova-bar-metrics.js');
19
-			// Nova::style('nova-bar-metrics', __DIR__ . '/../dist/css/nova-bar-metrics.css');
20
-		});
12
+    /**
13
+     * Bootstrap any application services.
14
+     */
15
+    public function boot()
16
+    {
17
+        Nova::serving(function (ServingNova $event) {
18
+            Nova::script('nova-bar-metrics', __DIR__ . '/../dist/js/nova-bar-metrics.js');
19
+            // Nova::style('nova-bar-metrics', __DIR__ . '/../dist/css/nova-bar-metrics.css');
20
+        });
21 21
 
22 22
     $this->bootCommands();
23
-	}
23
+    }
24 24
 
25
-	/**
26
-	 * Register any application services.
27
-	 */
28
-	public function register()
29
-	{
30
-	}
25
+    /**
26
+     * Register any application services.
27
+     */
28
+    public function register()
29
+    {
30
+    }
31 31
 
32
-  /**
33
-   * Boot the custom commands
34
-   *
35
-   * @return void
36
-   */
37
-  private function bootCommands()
38
-  {
32
+    /**
33
+     * Boot the custom commands
34
+     *
35
+     * @return void
36
+     */
37
+    private function bootCommands()
38
+    {
39 39
     if ($this->app->runningInConsole()) {
40
-      $this->commands([
40
+        $this->commands([
41 41
         BarMetricCommand::class,
42
-      ]);
42
+        ]);
43
+    }
43 44
     }
44
-  }
45 45
 }
Please login to merge, or discard this patch.
src/Console/BarMetricCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
      */
49 49
     protected function getStub()
50 50
     {
51
-        return __DIR__.'/stubs/barmetric.stub';
51
+        return __DIR__ . '/stubs/barmetric.stub';
52 52
     }
53 53
 
54 54
     /**
@@ -59,6 +59,6 @@  discard block
 block discarded – undo
59 59
      */
60 60
     protected function getDefaultNamespace($rootNamespace)
61 61
     {
62
-        return $rootNamespace.'\Nova\Metrics';
62
+        return $rootNamespace . '\Nova\Metrics';
63 63
     }
64 64
 }
Please login to merge, or discard this patch.