Skip to content

Commit 681db9d

Browse files
committed
Run PHPCS cleanup
1 parent 35a9235 commit 681db9d

12 files changed

Lines changed: 25 additions & 20 deletions

File tree

src/Controller/Admin/QueueController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ protected function refererRedirect(array|string $default) {
286286
if (is_array($url)) {
287287
throw new NotFoundException('Invalid array in query string');
288288
}
289-
if ($url && (mb_substr((string) $url, 0, 1) !== '/' || mb_substr((string) $url, 0, 2) === '//')) {
289+
if ($url && (mb_substr((string)$url, 0, 1) !== '/' || mb_substr((string)$url, 0, 2) === '//')) {
290290
$url = null;
291291
}
292292

src/Model/Behavior/JsonableBehavior.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ protected function _getMappedFields() {
173173
*/
174174
public function _encode($val) {
175175
if (!empty($this->_config['fields']) && $this->_config['input'] === 'json') {
176-
if (!is_string($val)) {
176+
if (!is_string($val)) {
177177
throw new InvalidArgumentException('Only accepts JSON string for input type `json`');
178-
}
179-
$val = $this->_fromJson($val);
180-
}
178+
}
179+
$val = $this->_fromJson($val);
180+
}
181181
if (!is_array($val)) {
182182
return null;
183183
}

src/Model/Table/QueuedJobsTable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public function createJob(string $jobTask, array|object|null $data = null, array
267267
* @return string
268268
*/
269269
protected function jobTask(string $jobType): string {
270-
if (!$this->taskFinder instanceof \Queue\Queue\TaskFinder) {
270+
if (!$this->taskFinder instanceof TaskFinder) {
271271
$this->taskFinder = new TaskFinder();
272272
}
273273

@@ -1260,7 +1260,7 @@ public function truncate(): void {
12601260
* @return string
12611261
*/
12621262
protected function getDriverName(): string {
1263-
$className = explode('\\', (string) $this->getConnection()->config()['driver']);
1263+
$className = explode('\\', (string)$this->getConnection()->config()['driver']);
12641264

12651265
return end($className) ?: '';
12661266
}

src/Queue/Task/EmailTask.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function run(array $data, int $jobId): void {
205205
}
206206

207207
foreach ($settings as $method => $setting) {
208-
$setter = 'set' . ucfirst((string) $method);
208+
$setter = 'set' . ucfirst((string)$method);
209209
if (in_array($method, ['theme', 'template', 'layout'], true)) {
210210
call_user_func_array([$this->mailer->viewBuilder(), $setter], (array)$setting);
211211

src/View/Helper/QueueHelper.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public function hasFailed(QueuedJob $queuedJob): bool {
3636

3737
// Requeued
3838
$taskConfig = $this->taskConfig($queuedJob->job_task);
39-
return !($taskConfig && $queuedJob->attempts <= $taskConfig['retries']);
39+
40+
return !($taskConfig && $queuedJob->attempts <= $taskConfig['retries']);
4041
}
4142

4243
/**
@@ -81,7 +82,8 @@ public function isRequeued(QueuedJob $queuedJob): bool {
8182
}
8283

8384
$taskConfig = $this->taskConfig($queuedJob->job_task);
84-
return $taskConfig && $queuedJob->attempts <= $taskConfig['retries'];
85+
86+
return $taskConfig && $queuedJob->attempts <= $taskConfig['retries'];
8587
}
8688

8789
/**
@@ -103,8 +105,9 @@ public function isRestarted(QueuedJob $queuedJob): bool {
103105
if ($queuedJob->attempts < 1) {
104106
return false;
105107
}
106-
// Must NOT have a failure_message (it was cleared by reset)
107-
return !$queuedJob->failure_message;
108+
109+
// Must NOT have a failure_message (it was cleared by reset)
110+
return !$queuedJob->failure_message;
108111
}
109112

110113
/**

tests/TestCase/Command/RunCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testServiceInjection(): void {
7878
*/
7979
protected function _needsConnection() {
8080
$config = ConnectionManager::getConfig('test');
81-
$skip = !str_contains((string) $config['driver'], 'Mysql') && !str_contains((string) $config['driver'], 'Postgres');
81+
$skip = !str_contains((string)$config['driver'], 'Mysql') && !str_contains((string)$config['driver'], 'Postgres');
8282
$this->skipIf($skip, 'Only Mysql/Postgres is working yet for this.');
8383
}
8484

tests/TestCase/Controller/Admin/QueueControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ public function testIndexStandalone(): void {
349349
*/
350350
protected function _needsConnection() {
351351
$config = ConnectionManager::getConfig('test');
352-
$skip = !str_contains((string) $config['driver'], 'Mysql') && !str_contains((string) $config['driver'], 'Postgres');
352+
$skip = !str_contains((string)$config['driver'], 'Mysql') && !str_contains((string)$config['driver'], 'Postgres');
353353
$this->skipIf($skip, 'Only Mysql/Postgres is working yet for this.');
354354
}
355355

tests/TestCase/Controller/Admin/QueuedJobsControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ public function testImport() {
433433
*/
434434
protected function _needsConnection() {
435435
$config = ConnectionManager::getConfig('test');
436-
$skip = !str_contains((string) $config['driver'], 'Mysql') && !str_contains((string) $config['driver'], 'Postgres');
436+
$skip = !str_contains((string)$config['driver'], 'Mysql') && !str_contains((string)$config['driver'], 'Postgres');
437437
$this->skipIf($skip, 'Only Mysql/Postgres is working yet for this.');
438438
}
439439

tests/TestCase/Model/Table/QueuedJobsTableTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,10 @@ public function testSequence() {
323323
/**
324324
* Test creating Jobs to run close to a specified time, and strtotime parsing.
325325
* Using toUnixString() function to convert Time object to timestamp, instead of strtotime
326+
*
327+
* @return void
326328
*/
327-
public function testNotBefore() {
329+
public function testNotBefore() {
328330
$this->assertTrue((bool)$this->QueuedJobs->createJob('Foo', null, ['notBefore' => '+ 1 Min']));
329331
$this->assertTrue((bool)$this->QueuedJobs->createJob('Foo', null, ['notBefore' => '+ 1 Day']));
330332
$this->assertTrue((bool)$this->QueuedJobs->createJob('Foo', null, ['notBefore' => '2009-07-01 12:00:00']));
@@ -943,7 +945,7 @@ public function testJobCreatedEventFired(): void {
943945
*/
944946
protected function _needsConnection() {
945947
$config = ConnectionManager::getConfig('test');
946-
$skip = !str_contains((string) $config['driver'], 'Mysql') && !str_contains((string) $config['driver'], 'Postgres');
948+
$skip = !str_contains((string)$config['driver'], 'Mysql') && !str_contains((string)$config['driver'], 'Postgres');
947949
$this->skipIf($skip, 'Only Mysql/Postgres is working yet for this.');
948950
}
949951

tests/TestCase/Queue/ProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ public function testRunVerboseShowsIdlePollOutput() {
222222
*/
223223
protected function _needsConnection() {
224224
$config = ConnectionManager::getConfig('test');
225-
$skip = !str_contains((string) $config['driver'], 'Mysql') && !str_contains((string) $config['driver'], 'Postgres');
225+
$skip = !str_contains((string)$config['driver'], 'Mysql') && !str_contains((string)$config['driver'], 'Postgres');
226226
$this->skipIf($skip, 'Only Mysql/Postgres is working yet for this.');
227227
}
228228

0 commit comments

Comments
 (0)