Skip to content

Commit 5b6a482

Browse files
committed
Fix style
1 parent 77f76a1 commit 5b6a482

File tree

2 files changed

+23
-38
lines changed

2 files changed

+23
-38
lines changed

src/Queue/Failed/MongoFailedJobProvider.php

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ class MongoFailedJobProvider extends DatabaseFailedJobProvider
2525
*/
2626
public function log($connection, $queue, $payload, $exception)
2727
{
28-
$this->getTable()->insert(
29-
[
30-
'connection' => $connection,
31-
'queue' => $queue,
32-
'payload' => $payload,
33-
'failed_at' => new UTCDateTime(Carbon::now()),
34-
'exception' => (string) $exception,
35-
],
36-
);
28+
$this->getTable()->insert([
29+
'connection' => $connection,
30+
'queue' => $queue,
31+
'payload' => $payload,
32+
'failed_at' => new UTCDateTime(Carbon::now()),
33+
'exception' => (string) $exception,
34+
]);
3735
}
3836

3937
/**
@@ -45,14 +43,11 @@ public function all()
4543
{
4644
$all = $this->getTable()->orderBy('_id', 'desc')->get()->all();
4745

48-
$all = array_map(
49-
function ($job) {
50-
$job['id'] = (string) $job['_id'];
46+
$all = array_map(function ($job) {
47+
$job['id'] = (string) $job['_id'];
5148

52-
return (object) $job;
53-
},
54-
$all,
55-
);
49+
return (object) $job;
50+
}, $all);
5651

5752
return $all;
5853
}

tests/QueueTest.php

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,7 @@ public function setUp(): void
3333
public function testQueueJobLifeCycle(): void
3434
{
3535
$uuid = Str::uuid();
36-
37-
Str::createUuidsUsing(
38-
function () use ($uuid) {
39-
return $uuid;
40-
},
41-
);
36+
Str::createUuidsUsing(fn () => $uuid);
4237

4338
$id = Queue::push('test', ['action' => 'QueueJobLifeCycle'], 'test');
4439
$this->assertNotNull($id);
@@ -47,22 +42,17 @@ function () use ($uuid) {
4742
$job = Queue::pop('test');
4843
$this->assertInstanceOf(MongoJob::class, $job);
4944
$this->assertEquals(1, $job->isReserved());
50-
$this->assertEquals(
51-
json_encode(
52-
[
53-
'uuid' => $uuid,
54-
'displayName' => 'test',
55-
'job' => 'test',
56-
'maxTries' => null,
57-
'maxExceptions' => null,
58-
'failOnTimeout' => false,
59-
'backoff' => null,
60-
'timeout' => null,
61-
'data' => ['action' => 'QueueJobLifeCycle'],
62-
],
63-
),
64-
$job->getRawBody(),
65-
);
45+
$this->assertEquals(json_encode([
46+
'uuid' => $uuid,
47+
'displayName' => 'test',
48+
'job' => 'test',
49+
'maxTries' => null,
50+
'maxExceptions' => null,
51+
'failOnTimeout' => false,
52+
'backoff' => null,
53+
'timeout' => null,
54+
'data' => ['action' => 'QueueJobLifeCycle'],
55+
]), $job->getRawBody());
6656

6757
// Remove reserved job
6858
$job->delete();

0 commit comments

Comments
 (0)