Skip to content

Commit 8fee026

Browse files
palpalanigithub-actions[bot]
authored andcommitted
Fixed code styling
1 parent b8d0bcf commit 8fee026

File tree

4 files changed

+10
-32
lines changed

4 files changed

+10
-32
lines changed

src/Jobs/DispatcherJob.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ class DispatcherJob implements ShouldQueue
1717

1818
protected bool $plain = false;
1919

20-
public function __construct(protected $data)
21-
{
22-
}
20+
public function __construct(protected $data) {}
2321

2422
/**
2523
* @return mixed
@@ -37,7 +35,6 @@ public function getPayload()
3735
}
3836

3937
/**
40-
* @param bool $plain
4138
* @return $this
4239
*/
4340
public function setPlain(bool $plain = true): self
@@ -47,9 +44,6 @@ public function setPlain(bool $plain = true): self
4744
return $this;
4845
}
4946

50-
/**
51-
* @return bool
52-
*/
5347
public function isPlain(): bool
5448
{
5549
return $this->plain;

src/Sqs/Connector.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class Connector extends SqsConnector
1313
/**
1414
* Establish a queue connection.
1515
*
16-
* @param array $config
1716
* @return \Illuminate\Contracts\Queue\Queue
1817
*/
1918
public function connect(array $config)

src/Sqs/Queue.php

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class Queue extends SqsQueue
2323
* @param object|string $job
2424
* @param string $queue
2525
* @param mixed $data
26-
* @return string
2726
*
2827
* @throws JsonException
2928
*/
@@ -33,18 +32,14 @@ protected function createPayload($job, $queue = null, $data = ''): string
3332
return parent::createPayload($job, $queue, $data);
3433
}
3534

36-
$handlerJob = $this->getClass($queue).'@handle';
35+
$handlerJob = $this->getClass($queue) . '@handle';
3736

3837
return $job->isPlain() ? \json_encode($job->getPayload(), JSON_THROW_ON_ERROR) : \json_encode([
3938
'job' => $handlerJob,
4039
'data' => $job->getPayload(),
4140
], JSON_THROW_ON_ERROR);
4241
}
4342

44-
/**
45-
* @param $queue
46-
* @return string
47-
*/
4843
private function getClass($queue = null): string
4944
{
5045
if (! $queue) {
@@ -100,20 +95,16 @@ public function pop($queue = null)
10095
return new SqsJob($this->container, $this->sqs, $response, $this->connectionName, $queue);
10196
}
10297
} catch (AwsException $e) {
103-
$msg = 'Line: '.$e->getLine().', '.$e->getFile().', '.$e->getMessage();
98+
$msg = 'Line: ' . $e->getLine() . ', ' . $e->getFile() . ', ' . $e->getMessage();
10499

105-
throw new \RuntimeException('Aws SQS error: '.$msg);
100+
throw new \RuntimeException('Aws SQS error: ' . $msg);
106101
}
107102
}
108103

109104
/**
110-
* @param array|string $payload
111-
* @param string $class
112-
* @return array|string
113-
*
114105
* @throws JsonException
115106
*/
116-
private function modifySinglePayload(array | string $payload, string $class): array | string
107+
private function modifySinglePayload(array|string $payload, string $class): array|string
117108
{
118109
if (! is_array($payload)) {
119110
$payload = \json_decode($payload, true, 512, JSON_THROW_ON_ERROR);
@@ -123,21 +114,17 @@ private function modifySinglePayload(array | string $payload, string $class): ar
123114

124115
$payload['Body'] = \json_encode([
125116
'uuid' => (string) Str::uuid(),
126-
'job' => $class.'@handle',
117+
'job' => $class . '@handle',
127118
'data' => $body['data'] ?? $body,
128119
], JSON_THROW_ON_ERROR);
129120

130121
return $payload;
131122
}
132123

133124
/**
134-
* @param array|string $payload
135-
* @param string $class
136-
* @return array
137-
*
138125
* @throws JsonException
139126
*/
140-
private function modifyMultiplePayload(array | string $payload, string $class): array
127+
private function modifyMultiplePayload(array|string $payload, string $class): array
141128
{
142129
if (! is_array($payload)) {
143130
$payload = \json_decode($payload, true, 512, JSON_THROW_ON_ERROR);
@@ -173,7 +160,7 @@ private function modifyMultiplePayload(array | string $payload, string $class):
173160
'ReceiptHandle' => $receiptHandle,
174161
'Body' => \json_encode([
175162
'uuid' => (string) Str::uuid(),
176-
'job' => $class.'@handle',
163+
'job' => $class . '@handle',
177164
'data' => $body,
178165
], JSON_THROW_ON_ERROR),
179166
'Attributes' => $attributes,
@@ -183,8 +170,6 @@ private function modifyMultiplePayload(array | string $payload, string $class):
183170
/**
184171
* @param string $payload
185172
* @param string|null $queue
186-
* @param array $options
187-
* @return mixed
188173
*
189174
* @throws JsonException
190175
*/

src/SqsQueueReaderServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function boot(): void
2020
{
2121
if ($this->app->runningInConsole()) {
2222
$this->publishes([
23-
__DIR__.'/../config/sqs-queue-reader.php' => config_path('sqs-queue-reader.php'),
23+
__DIR__ . '/../config/sqs-queue-reader.php' => config_path('sqs-queue-reader.php'),
2424
], 'config');
2525

2626
Queue::after(function (JobProcessed $event) {
@@ -47,7 +47,7 @@ public function boot(): void
4747

4848
public function register(): void
4949
{
50-
$this->mergeConfigFrom(__DIR__.'/../config/sqs-queue-reader.php', 'sqs-queue-reader');
50+
$this->mergeConfigFrom(__DIR__ . '/../config/sqs-queue-reader.php', 'sqs-queue-reader');
5151

5252
$this->app->booted(function () {
5353
$this->app['queue']->extend('sqs-json', static function () {

0 commit comments

Comments
 (0)