Skip to content

Commit a720de7

Browse files
authored
[1.x] Pint (#2)
* Update .gitattributes * Create coding-standards.yml * Fix code styling --------- Co-authored-by: driesvints <driesvints@users.noreply.github.com>
1 parent 17ee3ae commit a720de7

File tree

5 files changed

+31
-26
lines changed

5 files changed

+31
-26
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
.editorconfig export-ignore
1313
.gitattributes export-ignore
1414
.gitignore export-ignore
15-
.styleci.yml export-ignore
1615
CHANGELOG.md export-ignore
1716
phpunit.xml.dist export-ignore
1817
UPGRADE.md export-ignore
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: fix code styling
2+
3+
on: [push]
4+
5+
jobs:
6+
lint:
7+
uses: laravel/.github/.github/workflows/coding-standards.yml@main

config/pulse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
'path' => env('PULSE_PATH', 'pulse'),
66

77
'middleware' => [
8-
'web'
8+
'web',
99
],
1010

1111
// The name that will appear in the dashboard after running the `pulse:check` command.

src/Pulse.php

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function servers()
2222
'cpu' => (int) $server['cpu'],
2323
'memory_used' => (int) $server['memory_used'],
2424
'memory_total' => (int) $server['memory_total'],
25-
'storage' => json_decode($server['storage'])
25+
'storage' => json_decode($server['storage']),
2626
])
2727
->values();
2828

@@ -44,7 +44,7 @@ public function userRequestCounts()
4444
RedisAdapter::zunionstore(
4545
'pulse_user_request_counts:7-day',
4646
collect(range(0, 6))
47-
->map(fn ($days) => 'pulse_user_request_counts:' . now()->subDays($days)->format('Y-m-d'))
47+
->map(fn ($days) => 'pulse_user_request_counts:'.now()->subDays($days)->format('Y-m-d'))
4848
->toArray()
4949
);
5050

@@ -72,25 +72,25 @@ public function slowEndpoints()
7272
RedisAdapter::zunionstore(
7373
'pulse_slow_endpoint_request_counts:7-day',
7474
collect(range(0, 6))
75-
->map(fn ($days) => 'pulse_slow_endpoint_request_counts:' . now()->subDays($days)->format('Y-m-d'))
75+
->map(fn ($days) => 'pulse_slow_endpoint_request_counts:'.now()->subDays($days)->format('Y-m-d'))
7676
->toArray(),
77-
'SUM'
77+
'SUM'
7878
);
7979

8080
RedisAdapter::zunionstore(
8181
'pulse_slow_endpoint_total_durations:7-day',
8282
collect(range(0, 6))
83-
->map(fn ($days) => 'pulse_slow_endpoint_total_durations:' . now()->subDays($days)->format('Y-m-d'))
83+
->map(fn ($days) => 'pulse_slow_endpoint_total_durations:'.now()->subDays($days)->format('Y-m-d'))
8484
->toArray(),
85-
'SUM'
85+
'SUM'
8686
);
8787

8888
RedisAdapter::zunionstore(
8989
'pulse_slow_endpoint_slowest_durations:7-day',
9090
collect(range(0, 6))
91-
->map(fn ($days) => 'pulse_slow_endpoint_slowest_durations:' . now()->subDays($days)->format('Y-m-d'))
91+
->map(fn ($days) => 'pulse_slow_endpoint_slowest_durations:'.now()->subDays($days)->format('Y-m-d'))
9292
->toArray(),
93-
'MAX'
93+
'MAX'
9494
);
9595

9696
$requestCounts = RedisAdapter::zrevrange('pulse_slow_endpoint_request_counts:7-day', 0, -1, true);
@@ -119,9 +119,9 @@ public function usersExperiencingSlowEndpoints()
119119
RedisAdapter::zunionstore(
120120
'pulse_slow_endpoint_user_counts:7-day',
121121
collect(range(0, 6))
122-
->map(fn ($days) => 'pulse_slow_endpoint_user_counts:' . now()->subDays($days)->format('Y-m-d'))
122+
->map(fn ($days) => 'pulse_slow_endpoint_user_counts:'.now()->subDays($days)->format('Y-m-d'))
123123
->toArray(),
124-
'SUM'
124+
'SUM'
125125
);
126126

127127
$userCounts = collect(RedisAdapter::zrevrange('pulse_slow_endpoint_user_counts:7-day', 0, -1, true));
@@ -148,25 +148,25 @@ public function slowQueries()
148148
RedisAdapter::zunionstore(
149149
'pulse_slow_query_execution_counts:7-day',
150150
collect(range(0, 6))
151-
->map(fn ($days) => 'pulse_slow_query_execution_counts:' . now()->subDays($days)->format('Y-m-d'))
151+
->map(fn ($days) => 'pulse_slow_query_execution_counts:'.now()->subDays($days)->format('Y-m-d'))
152152
->toArray(),
153-
'SUM'
153+
'SUM'
154154
);
155155

156156
RedisAdapter::zunionstore(
157157
'pulse_slow_query_total_durations:7-day',
158158
collect(range(0, 6))
159-
->map(fn ($days) => 'pulse_slow_query_total_durations:' . now()->subDays($days)->format('Y-m-d'))
159+
->map(fn ($days) => 'pulse_slow_query_total_durations:'.now()->subDays($days)->format('Y-m-d'))
160160
->toArray(),
161-
'SUM'
161+
'SUM'
162162
);
163163

164164
RedisAdapter::zunionstore(
165165
'pulse_slow_query_slowest_durations:7-day',
166166
collect(range(0, 6))
167-
->map(fn ($days) => 'pulse_slow_query_slowest_durations:' . now()->subDays($days)->format('Y-m-d'))
167+
->map(fn ($days) => 'pulse_slow_query_slowest_durations:'.now()->subDays($days)->format('Y-m-d'))
168168
->toArray(),
169-
'MAX'
169+
'MAX'
170170
);
171171

172172
$executionCounts = RedisAdapter::zrevrange('pulse_slow_query_execution_counts:7-day', 0, -1, true);
@@ -175,7 +175,6 @@ public function slowQueries()
175175

176176
return collect($executionCounts)
177177
->map(function ($executionCount, $sql) use ($totalDurations, $slowestDurations) {
178-
179178
return [
180179
'sql' => $sql,
181180
'execution_count' => (int) $executionCount,
@@ -189,11 +188,11 @@ public function slowQueries()
189188
public function cacheStats()
190189
{
191190
$hits = collect(range(0, 6))
192-
->map(fn ($days) => RedisAdapter::get('pulse_cache_hits:' . now()->subDays($days)->format('Y-m-d')))
191+
->map(fn ($days) => RedisAdapter::get('pulse_cache_hits:'.now()->subDays($days)->format('Y-m-d')))
193192
->sum();
194193

195194
$misses = collect(range(0, 6))
196-
->map(fn ($days) => RedisAdapter::get('pulse_cache_misses:' . now()->subDays($days)->format('Y-m-d')))
195+
->map(fn ($days) => RedisAdapter::get('pulse_cache_misses:'.now()->subDays($days)->format('Y-m-d')))
197196
->sum();
198197

199198
$total = $hits + $misses;
@@ -216,17 +215,17 @@ public function exceptions()
216215
RedisAdapter::zunionstore(
217216
'pulse_exception_counts:7-day',
218217
collect(range(0, 6))
219-
->map(fn ($days) => 'pulse_exception_counts:' . now()->subDays($days)->format('Y-m-d'))
218+
->map(fn ($days) => 'pulse_exception_counts:'.now()->subDays($days)->format('Y-m-d'))
220219
->toArray(),
221-
'SUM'
220+
'SUM'
222221
);
223222

224223
RedisAdapter::zunionstore(
225224
'pulse_exception_last_occurrences:7-day',
226225
collect(range(0, 6))
227-
->map(fn ($days) => 'pulse_exception_last_occurrences:' . now()->subDays($days)->format('Y-m-d'))
226+
->map(fn ($days) => 'pulse_exception_last_occurrences:'.now()->subDays($days)->format('Y-m-d'))
228227
->toArray(),
229-
'MAX'
228+
'MAX'
230229
);
231230

232231
$exceptionCounts = RedisAdapter::zrevrange('pulse_exception_counts:7-day', 0, -1, true);

src/PulseServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Illuminate\Support\Facades\Event;
1313
use Illuminate\Support\Facades\Route;
1414
use Illuminate\Support\ServiceProvider;
15-
use Laravel\Pulse\View\Components\Pulse as PulseComponent;
1615
use Laravel\Pulse\Commands\CheckCommand;
1716
use Laravel\Pulse\Contracts\ShouldNotReportUsage;
1817
use Laravel\Pulse\Handlers\HandleCacheHit;
@@ -28,6 +27,7 @@
2827
use Laravel\Pulse\Http\Livewire\SlowEndpoints;
2928
use Laravel\Pulse\Http\Livewire\SlowQueries;
3029
use Laravel\Pulse\Http\Livewire\Usage;
30+
use Laravel\Pulse\View\Components\Pulse as PulseComponent;
3131
use Livewire\Livewire;
3232
use Throwable;
3333

0 commit comments

Comments
 (0)