Skip to content

Commit 94ae3b4

Browse files
committed
Pint
1 parent ff8f7b2 commit 94ae3b4

File tree

3 files changed

+14
-17
lines changed

3 files changed

+14
-17
lines changed

src/CloudTasksQueue.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function ($payload, $queue) {
7979
*/
8080
public function pushRaw($payload, $queue = null, array $options = [])
8181
{
82-
$delay = !empty($options['delay']) ? $options['delay'] : 0;
82+
$delay = ! empty($options['delay']) ? $options['delay'] : 0;
8383

8484
return $this->pushToCloudTasks($queue, $payload, $delay);
8585
}
@@ -130,14 +130,14 @@ protected function pushToCloudTasks($queue, $payload, $delay = 0)
130130
$task = $this->createTask();
131131
$task->setName($this->taskName($queue, $payload));
132132

133-
if (!empty($this->config['app_engine'])) {
133+
if (! empty($this->config['app_engine'])) {
134134
$path = \Safe\parse_url(route('cloud-tasks.handle-task'), PHP_URL_PATH);
135135

136136
$appEngineRequest = new AppEngineHttpRequest();
137137
$appEngineRequest->setRelativeUri($path);
138138
$appEngineRequest->setHttpMethod(HttpMethod::POST);
139139
$appEngineRequest->setBody(json_encode($payload));
140-
if (!empty($service = $this->config['app_engine_service'])) {
140+
if (! empty($service = $this->config['app_engine_service'])) {
141141
$routing = new AppEngineRouting();
142142
$routing->setService($service);
143143
$appEngineRequest->setAppEngineRouting($routing);
@@ -159,7 +159,6 @@ protected function pushToCloudTasks($queue, $payload, $delay = 0)
159159
$task->setHttpRequest($httpRequest);
160160
}
161161

162-
163162
// The deadline for requests sent to the app. If the app does not respond by
164163
// this deadline then the request is cancelled and the attempt is marked as
165164
// a failure. Cloud Tasks will retry the task according to the RetryConfig.
@@ -213,7 +212,7 @@ private function withAttempts(array $payload): array
213212
/**
214213
* Pop the next job off of the queue.
215214
*
216-
* @param string|null $queue
215+
* @param string|null $queue
217216
* @return \Illuminate\Contracts\Queue\Job|null
218217
*/
219218
public function pop($queue = null)
@@ -243,7 +242,7 @@ public function delete(CloudTasksJob $job): void
243242
$config['project'],
244243
$config['location'],
245244
$queue,
246-
(string)$headerTaskName
245+
(string) $headerTaskName
247246
);
248247

249248
CloudTasksApi::deleteTask($taskName);

src/DashboardService.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Stackkit\LaravelGoogleCloudTasksQueue;
66

77
use Exception;
8-
use Google\Cloud\Tasks\V2\HttpRequest;
98
use Google\Cloud\Tasks\V2\Task;
109
use Illuminate\Database\Eloquent\ModelNotFoundException;
1110
use Illuminate\Queue\Events\JobExceptionOccurred;

src/TaskHandler.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
use Illuminate\Support\Str;
1212
use Illuminate\Validation\ValidationException;
1313
use Safe\Exceptions\JsonException;
14-
use UnexpectedValueException;
15-
use stdClass;
14+
1615
use function Safe\json_decode;
1716

1817
class TaskHandler
@@ -57,7 +56,7 @@ public function handle(?string $task = null): void
5756
*/
5857
private function captureTask($task): array
5958
{
60-
$task = $task ?: (string)(request()->getContent());
59+
$task = $task ?: (string) (request()->getContent());
6160

6261
try {
6362
$array = json_decode($task, true);
@@ -66,12 +65,12 @@ private function captureTask($task): array
6665
}
6766

6867
$validator = validator([
69-
'json' => $task,
70-
'task' => $array,
68+
'json' => $task,
69+
'task' => $array,
7170
], [
72-
'json' => 'required|json',
73-
'task' => 'required|array',
74-
'task.data' => 'required|array',
71+
'json' => 'required|json',
72+
'task' => 'required|array',
73+
'task.data' => 'required|array',
7574
]);
7675

7776
try {
@@ -148,11 +147,11 @@ private function handleTask(array $task): void
148147
public static function getCommandProperties(string $command): array
149148
{
150149
if (Str::startsWith($command, 'O:')) {
151-
return (array)unserialize($command, ['allowed_classes' => false]);
150+
return (array) unserialize($command, ['allowed_classes' => false]);
152151
}
153152

154153
if (app()->bound(Encrypter::class)) {
155-
return (array)unserialize(
154+
return (array) unserialize(
156155
app(Encrypter::class)->decrypt($command),
157156
['allowed_classes' => ['Illuminate\Support\Carbon']]
158157
);

0 commit comments

Comments
 (0)