Skip to content

Commit 6dd9e7d

Browse files
palpalaniactions-user
authored andcommitted
Fix styling
1 parent 6fe11bb commit 6dd9e7d

File tree

6 files changed

+22
-19
lines changed

6 files changed

+22
-19
lines changed

src/Jobs/DispatcherJob.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
namespace palPalani\SqsQueueReader\Jobs;
44

55
use Illuminate\Bus\Queueable;
6-
use Illuminate\Queue\SerializesModels;
7-
use Illuminate\Queue\InteractsWithQueue;
86
use Illuminate\Contracts\Queue\ShouldQueue;
7+
use Illuminate\Queue\InteractsWithQueue;
8+
use Illuminate\Queue\SerializesModels;
99

1010
class DispatcherJob implements ShouldQueue
1111
{
12-
use InteractsWithQueue, Queueable, SerializesModels;
12+
use InteractsWithQueue;
13+
use Queueable;
14+
use SerializesModels;
1315

1416
/**
1517
* @var mixed
@@ -38,7 +40,7 @@ public function getPayload()
3840
if (! $this->isPlain()) {
3941
return [
4042
'job' => app('config')->get('sqs-plain.default-handler'),
41-
'data' => $this->data
43+
'data' => $this->data,
4244
];
4345
}
4446

src/Sqs/Connector.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
namespace palPalani\SqsQueueReader\Sqs;
44

55
use Aws\Sqs\SqsClient;
6-
use Illuminate\Support\Arr;
76
use Illuminate\Queue\Connectors\SqsConnector;
8-
use Illuminate\Queue\Jobs\SqsJob;
7+
use Illuminate\Support\Arr;
98

109
class Connector extends SqsConnector
1110
{
@@ -24,7 +23,9 @@ public function connect(array $config)
2423
}
2524

2625
return new Queue(
27-
new SqsClient($config), $config['queue'], Arr::get($config, 'prefix', '')
26+
new SqsClient($config),
27+
$config['queue'],
28+
Arr::get($config, 'prefix', '')
2829
);
2930
}
3031
}

src/Sqs/Queue.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace palPalani\SqsQueueReader\Sqs;
44

5-
use palPalani\SqsQueueReader\Jobs\DispatcherJob;
5+
use Illuminate\Queue\Jobs\SqsJob;
66
use Illuminate\Queue\SqsQueue;
77
use Illuminate\Support\Facades\Config;
8-
use Illuminate\Queue\Jobs\SqsJob;
8+
use palPalani\SqsQueueReader\Jobs\DispatcherJob;
99

1010
/**
1111
* Class CustomSqsQueue
@@ -23,7 +23,7 @@ class Queue extends SqsQueue
2323
*/
2424
protected function createPayload($job, $data = '', $queue = null)
2525
{
26-
if (!$job instanceof DispatcherJob) {
26+
if (! $job instanceof DispatcherJob) {
2727
return parent::createPayload($job, $data, $queue);
2828
}
2929

@@ -38,7 +38,7 @@ protected function createPayload($job, $data = '', $queue = null)
3838
*/
3939
private function getClass($queue = null)
4040
{
41-
if (!$queue) {
41+
if (! $queue) {
4242
return Config::get('sqs-queue-reader.default-handler');
4343
}
4444

@@ -89,13 +89,15 @@ public function pop($queue = null)
8989
*/
9090
private function modifyPayload($payload, $class)
9191
{
92-
if (! is_array($payload)) $payload = json_decode($payload, true);
92+
if (! is_array($payload)) {
93+
$payload = json_decode($payload, true);
94+
}
9395

9496
$body = json_decode($payload['Body'], true);
9597

9698
$body = [
9799
'job' => $class . '@handle',
98-
'data' => isset($body['data']) ? $body['data'] : $body
100+
'data' => isset($body['data']) ? $body['data'] : $body,
99101
];
100102

101103
$payload['Body'] = json_encode($body);

src/SqsQueueReaderServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace palPalani\SqsQueueReader;
44

5-
use palPalani\SqsQueueReader\Sqs\Connector;
65
use Illuminate\Queue\Events\JobProcessed;
76
use Illuminate\Support\Facades\Queue;
87
use Illuminate\Support\ServiceProvider;
8+
use palPalani\SqsQueueReader\Sqs\Connector;
99

1010
class SqsQueueReaderServiceProvider extends ServiceProvider
1111
{

tests/SqsQueueReader/QueueTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace palPalani\SqsQueueReader\Tests;
44

5-
use Aws\Sqs\SqsClient;
65
use palPalani\SqsQueueReader\Jobs\DispatcherJob;
76
use palPalani\SqsQueueReader\Sqs\Queue;
87

@@ -17,9 +16,8 @@ class QueueTest extends \PHPUnit_Framework_TestCase
1716
*/
1817
public function class_named_is_derived_from_queue_name()
1918
{
20-
2119
$content = [
22-
'test' => 'test'
20+
'test' => 'test',
2321
];
2422

2523
$job = new DispatcherJob($content);
@@ -29,7 +27,8 @@ public function class_named_is_derived_from_queue_name()
2927
->getMock();
3028

3129
$method = new \ReflectionMethod(
32-
'palPalani\SqsQueueReader\Sqs\Queue', 'createPayload'
30+
'palPalani\SqsQueueReader\Sqs\Queue',
31+
'createPayload'
3332
);
3433

3534
$method->setAccessible(true);

tests/TestCase.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
namespace Palpalani\SqsQueueReader\Tests;
44

5-
use Illuminate\Database\Eloquent\Factories\Factory;
65
use Orchestra\Testbench\TestCase as Orchestra;
76
use Palpalani\SqsQueueReader\SqsQueueReaderServiceProvider;
87

0 commit comments

Comments
 (0)