Skip to content

Commit dd3339f

Browse files
Fix L versions and run pint
1 parent 3fb9fa0 commit dd3339f

File tree

10 files changed

+32
-41
lines changed

10 files changed

+32
-41
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
php: [8.3, 8.4]
18-
laravel: ['^11.0', '^12.0']
18+
laravel: ['^11.44.7', '^12.24.0']
1919
dependency-version: [prefer-stable]
2020
include:
21-
- laravel: "^12.0"
22-
testbench: 10.*
23-
- laravel: "^11.0"
24-
testbench: 9.*
21+
- laravel: "^12.24.0"
22+
testbench: "10.6.*"
23+
- laravel: "^11.44.7"
24+
testbench: "9.15.*"
2525

2626
name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }}
2727

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"phpstan/phpstan": "^2.1",
3232
"larastan/larastan": "^3.0",
3333
"orchestra/testbench": "^9.15|^10.6",
34-
"laravel/pint": "^1.16"
34+
"laravel/pint": "^1.25.1"
3535
},
3636
"scripts": {
3737
"test": "phpunit",

src/Console/QueueWorkBatchCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ protected function gatherWorkerOptions()
118118
/**
119119
* Store a failed job event.
120120
*
121-
* @param \Illuminate\Queue\Events\JobFailed $event
122121
* @return void
123122
*/
124123
protected function logFailedJob(JobFailed $event)

src/Contracts/JobContainerOverrides.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Laravel Queue for AWS Batch.
45
*
@@ -32,7 +33,6 @@
3233
* ]
3334
*
3435
* Interface JobContainerOverrides
35-
* @package LukeWaite\LaravelQueueAwsBatch\Contracts
3636
*/
3737
interface JobContainerOverrides
3838
{

src/Exceptions/JobNotFoundException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@
1212

1313
namespace LukeWaite\LaravelQueueAwsBatch\Exceptions;
1414

15-
class JobNotFoundException extends LaravelAwsBatchQueueException
16-
{
17-
}
15+
class JobNotFoundException extends LaravelAwsBatchQueueException {}

src/Exceptions/LaravelAwsBatchQueueException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@
1212

1313
namespace LukeWaite\LaravelQueueAwsBatch\Exceptions;
1414

15-
class LaravelAwsBatchQueueException extends \Exception
16-
{
17-
}
15+
class LaravelAwsBatchQueueException extends \Exception {}

src/Exceptions/UnsupportedException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@
1212

1313
namespace LukeWaite\LaravelQueueAwsBatch\Exceptions;
1414

15-
class UnsupportedException extends LaravelAwsBatchQueueException
16-
{
17-
}
15+
class UnsupportedException extends LaravelAwsBatchQueueException {}

src/Queues/BatchQueue.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ protected function getBatchDisplayName($job)
7878
*
7979
* @param string|null $queue
8080
* @param array $payload
81-
* @param string $jobName
82-
* @param mixed $job
81+
* @param string $jobName
82+
* @param mixed $job
8383
* @return int
8484
*/
8585
protected function pushToBatch($queue, $payload, $jobName, $job = null)
@@ -92,10 +92,10 @@ protected function pushToBatch($queue, $payload, $jobName, $job = null)
9292
'jobQueue' => $this->getQueue($queue),
9393
'parameters' => [
9494
'jobId' => $jobId,
95-
]
95+
],
9696
];
9797

98-
if (isset($job) && is_object($job) && $this->implementsJobContainerOverrides($job)) {
98+
if (isset($job) && is_object($job) && $this->implementsJobContainerOverrides($job)) {
9999
/** @var JobContainerOverrides $job */
100100
$overrides = $job->getBatchContainerOverrides();
101101

tests/BatchJobTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function setUp(): void
2020
{
2121
parent::setUp();
2222

23-
$this->job = new \stdClass();
23+
$this->job = new \stdClass;
2424
$this->job->payload = '{"job":"foo","data":["data"]}';
2525
$this->job->id = 4;
2626
$this->job->queue = 'default';
@@ -29,23 +29,23 @@ protected function setUp(): void
2929
$this->batchQueue = m::mock('LukeWaite\LaravelQueueAwsBatch\Queues\BatchQueue');
3030

3131
$this->batchJob = new BatchJob(
32-
new \Illuminate\Container\Container(),
32+
new \Illuminate\Container\Container,
3333
$this->batchQueue,
3434
$this->job,
3535
'testConnection',
3636
'defaultQueue',
3737
);
3838
}
3939

40-
public function testReleaseDoesntDeleteButDoesUpdate()
40+
public function test_release_doesnt_delete_but_does_update()
4141
{
4242
$this->batchQueue->shouldReceive('release')->once();
4343
$this->batchQueue->shouldNotReceive('deleteReserved');
4444

4545
$this->batchJob->release(0);
4646
}
4747

48-
public function testThrowsExceptionOnReleaseWIthDelay()
48+
public function test_throws_exception_on_release_w_ith_delay()
4949
{
5050
$this->expectException(UnsupportedException::class);
5151
$this->expectExceptionMessage('The BatchJob does not support releasing back onto the queue with a delay');

tests/BatchQueueTest.php

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ protected function setUp(): void
3434
$this->batch,
3535
);
3636

37-
$this->queue->setContainer(new \Illuminate\Container\Container());
37+
$this->queue->setContainer(new \Illuminate\Container\Container);
3838
}
3939

40-
public function testPushProperlyPushesJobOntoDatabase()
40+
public function test_push_properly_pushes_job_onto_database()
4141
{
4242
$this->database->shouldReceive('table')->with('table')->andReturn($query = m::mock('StdClass'));
4343

@@ -59,11 +59,11 @@ public function testPushProperlyPushesJobOntoDatabase()
5959
$this->assertEquals(['jobId' => 100], $array['parameters']);
6060
});
6161

62-
$result = $this->queue->push(new TestJob());
62+
$result = $this->queue->push(new TestJob);
6363
$this->assertEquals(100, $result);
6464
}
6565

66-
public function testPushProperlySanitizesJobName()
66+
public function test_push_properly_sanitizes_job_name()
6767
{
6868
$this->database->shouldReceive('table')->with('table')->andReturn($query = m::mock('StdClass'));
6969

@@ -76,10 +76,10 @@ public function testPushProperlySanitizesJobName()
7676
$this->assertEquals('LukeWaite_LaravelQueueAwsBatch_Tests_TestJob', $array['jobName']);
7777
});
7878

79-
$this->queue->push(new TestJob());
79+
$this->queue->push(new TestJob);
8080
}
8181

82-
public function testPushIncludesContainerOverridesWhenJobSupportsOverrides()
82+
public function test_push_includes_container_overrides_when_job_supports_overrides()
8383
{
8484
$overrides = ['vcpus' => 2];
8585

@@ -95,7 +95,7 @@ public function testPushIncludesContainerOverridesWhenJobSupportsOverrides()
9595
$this->queue->push(new TestJobWithOverrides($overrides));
9696
}
9797

98-
public function testGetJobById()
98+
public function test_get_job_by_id()
9999
{
100100
$testDate = Carbon::create(2016, 9, 4, 16);
101101
Carbon::setTestNow($testDate);
@@ -119,7 +119,7 @@ public function testGetJobById()
119119
Carbon::setTestNow();
120120
}
121121

122-
public function testRelease()
122+
public function test_release()
123123
{
124124
$this->database->shouldReceive('table')->once()->with('table')->andReturn($table = m::mock('StdClass'));
125125
$table->shouldReceive('where')->once()->with('id', 4)->andReturn($query = m::mock('StdClass'));
@@ -128,7 +128,7 @@ public function testRelease()
128128
'reserved_at' => null,
129129
])->andReturn(4);
130130

131-
$job = new \stdClass();
131+
$job = new \stdClass;
132132
$job->payload = '{"job":"foo","data":["data"]}';
133133
$job->id = 4;
134134
$job->queue = 'default';
@@ -138,28 +138,28 @@ public function testRelease()
138138
$this->assertEquals(4, $result);
139139
}
140140

141-
public function testPopThrowsException()
141+
public function test_pop_throws_exception()
142142
{
143143
$this->expectException(UnsupportedException::class);
144144
$this->expectExceptionMessage('The BatchQueue does not support running via a regular worker. Instead, you should use the queue:batch-work command with a job id.');
145145

146146
$this->queue->pop('default');
147147
}
148148

149-
public function testLaterThrowsException()
149+
public function test_later_throws_exception()
150150
{
151151
$this->expectException(UnsupportedException::class);
152152
$this->expectExceptionMessage('The BatchQueue does not support the later() operation.');
153153

154154
$this->queue->later(10, 'default');
155155
}
156156

157-
public function testReleaseWithDelayThrowsException()
157+
public function test_release_with_delay_throws_exception()
158158
{
159159
$this->expectException(UnsupportedException::class);
160160
$this->expectExceptionMessage('The BatchJob does not support releasing back onto the queue with a delay');
161161

162-
$job = new \stdClass();
162+
$job = new \stdClass;
163163
$job->payload = '{"job":"foo","data":["data"]}';
164164
$job->id = 4;
165165
$job->queue = 'default';
@@ -176,9 +176,7 @@ class TestJob
176176

177177
class TestJobWithOverrides implements JobContainerOverrides
178178
{
179-
public function __construct(private readonly array $overrides)
180-
{
181-
}
179+
public function __construct(private readonly array $overrides) {}
182180

183181
public function getBatchContainerOverrides(): ?array
184182
{

0 commit comments

Comments
 (0)