Skip to content

Commit 5e930e4

Browse files
dereuromarkwww-data
authored andcommitted
Auto-fix CS - CS master branch
1 parent be66c82 commit 5e930e4

File tree

11 files changed

+34
-23
lines changed

11 files changed

+34
-23
lines changed

src/Model/Table/Table.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Cake\ORM\TableRegistry;
77
use Cake\Routing\Router;
88
use Cake\Validation\Validation;
9+
use DateTimeInterface;
910
use InvalidArgumentException;
1011
use Shim\Model\Table\Table as ShimTable;
1112
use Tools\I18n\Date;
@@ -396,7 +397,7 @@ public function validateDateTime($value, array $options = [], array $context = [
396397
if ($after) {
397398
if (!is_object($after)) {
398399
$after = new DateTime($after);
399-
} elseif ($after instanceof \DateTimeInterface && !($after instanceof DateTime)) {
400+
} elseif ($after instanceof DateTimeInterface && !($after instanceof DateTime)) {
400401
$after = new DateTime($after);
401402
}
402403
}
@@ -408,7 +409,7 @@ public function validateDateTime($value, array $options = [], array $context = [
408409
if ($before) {
409410
if (!is_object($before)) {
410411
$before = new DateTime($before);
411-
} elseif ($before instanceof \DateTimeInterface && !($before instanceof DateTime)) {
412+
} elseif ($before instanceof DateTimeInterface && !($before instanceof DateTime)) {
412413
$before = new DateTime($before);
413414
}
414415
}
@@ -477,7 +478,7 @@ public function validateDate($value, array $options = [], array $context = []) {
477478
$date = $value;
478479
if (!is_object($value)) {
479480
$date = new Date($value);
480-
} elseif ($value instanceof \DateTimeInterface) {
481+
} elseif ($value instanceof DateTimeInterface) {
481482
$date = new Date($value);
482483
}
483484

@@ -494,7 +495,7 @@ public function validateDate($value, array $options = [], array $context = []) {
494495
/** @var \Cake\I18n\DateTime $after */
495496
if (!is_object($after)) {
496497
$after = new Date($after);
497-
} elseif ($after instanceof \DateTimeInterface) {
498+
} elseif ($after instanceof DateTimeInterface) {
498499
$after = new Date($after);
499500
}
500501
if ($after->greaterThan($compare)) {
@@ -511,7 +512,7 @@ public function validateDate($value, array $options = [], array $context = []) {
511512
/** @var \Cake\I18n\DateTime $before */
512513
if (!is_object($before)) {
513514
$before = new Date($before);
514-
} elseif ($before instanceof \DateTimeInterface) {
515+
} elseif ($before instanceof DateTimeInterface) {
515516
$before = new Date($before);
516517
}
517518
if ($before->lessThan($compare)) {
@@ -550,7 +551,7 @@ public function validateTime($value, array $options = [], array $context = []) {
550551
// Extract time string for validation
551552
$timeString = $value;
552553
if (is_object($value)) {
553-
if ($value instanceof \DateTimeInterface) {
554+
if ($value instanceof DateTimeInterface) {
554555
$timeString = $value->format('H:i:s');
555556
}
556557
} else {
@@ -584,7 +585,7 @@ public function validateTime($value, array $options = [], array $context = []) {
584585
$dateTimeParts = explode(' ', (string)$after, 2);
585586
$timeString = array_pop($dateTimeParts);
586587
$after = new Time($timeString);
587-
} elseif ($after instanceof \DateTimeInterface && !($after instanceof Time)) {
588+
} elseif ($after instanceof DateTimeInterface && !($after instanceof Time)) {
588589
$after = new Time($after->format('H:i:s'));
589590
}
590591

@@ -618,7 +619,7 @@ public function validateTime($value, array $options = [], array $context = []) {
618619
$dateTimeParts = explode(' ', (string)$before, 2);
619620
$timeString = array_pop($dateTimeParts);
620621
$before = new Time($timeString);
621-
} elseif ($before instanceof \DateTimeInterface && !($before instanceof Time)) {
622+
} elseif ($before instanceof DateTimeInterface && !($before instanceof Time)) {
622623
$before = new Time($before->format('H:i:s'));
623624
}
624625

tests/TestCase/Command/InflectCommandTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55

66
use Cake\Console\TestSuite\ConsoleIntegrationTestTrait;
77
use Cake\TestSuite\TestCase;
8+
use PHPUnit\Framework\Attributes\UsesClass;
89
use Tools\Command\InflectCommand;
910

1011
/**
1112
* Tools\Command\InflectCommand Test Case
1213
*/
13-
#[\PHPUnit\Framework\Attributes\UsesClass(InflectCommand::class)]
14+
#[UsesClass(InflectCommand::class)]
1415
class InflectCommandTest extends TestCase {
1516

1617
use ConsoleIntegrationTestTrait;

tests/TestCase/Controller/Admin/HelperControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
namespace Tools\Test\TestCase\Controller\Admin;
44

55
use Cake\TestSuite\IntegrationTestTrait;
6+
use PHPUnit\Framework\Attributes\UsesClass;
67
use Shim\TestSuite\TestCase;
78
use Tools\Controller\Admin\HelperController;
89

9-
#[\PHPUnit\Framework\Attributes\UsesClass(HelperController::class)]
10+
#[UsesClass(HelperController::class)]
1011
class HelperControllerTest extends TestCase {
1112

1213
use IntegrationTestTrait;

tests/TestCase/Controller/Admin/PagesControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
namespace Tools\Test\TestCase\Controller\Admin;
44

55
use Cake\TestSuite\IntegrationTestTrait;
6+
use PHPUnit\Framework\Attributes\UsesClass;
67
use Shim\TestSuite\TestCase;
78
use Tools\Controller\Admin\PagesController;
89

9-
#[\PHPUnit\Framework\Attributes\UsesClass(PagesController::class)]
10+
#[UsesClass(PagesController::class)]
1011
class PagesControllerTest extends TestCase {
1112

1213
use IntegrationTestTrait;

tests/TestCase/Controller/Admin/ToolsControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
namespace Tools\Test\TestCase\Controller\Admin;
44

55
use Cake\TestSuite\IntegrationTestTrait;
6+
use PHPUnit\Framework\Attributes\UsesClass;
67
use Shim\TestSuite\TestCase;
78
use Tools\Controller\Admin\ToolsController;
89

9-
#[\PHPUnit\Framework\Attributes\UsesClass(ToolsController::class)]
10+
#[UsesClass(ToolsController::class)]
1011
class ToolsControllerTest extends TestCase {
1112

1213
use IntegrationTestTrait;

tests/TestCase/Controller/Component/CommonComponentTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use Cake\Event\Event;
77
use Cake\Http\Exception\NotFoundException;
88
use Cake\Http\ServerRequest;
9+
use PHPUnit\Framework\Attributes\DoesNotPerformAssertions;
910
use Shim\TestSuite\TestCase;
1011
use TestApp\Controller\CommonComponentTestController;
1112
use Tools\Controller\Component\CommonComponent;
@@ -321,7 +322,7 @@ public function testTrimData() {
321322
*
322323
* @return void
323324
*/
324-
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
325+
#[DoesNotPerformAssertions]
325326
public function testAllowExtensionsNone(): void {
326327
$this->Controller->Common->allowExtensions('');
327328
}
@@ -342,7 +343,7 @@ public function testAllowExtensionsFail(): void {
342343
*
343344
* @return void
344345
*/
345-
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
346+
#[DoesNotPerformAssertions]
346347
public function testAllowExtensions(): void {
347348
$request = $this->Controller->getRequest();
348349
$request = $request->withParam('_ext', 'csv');
@@ -370,7 +371,7 @@ public function testAllowExtensionsWrongOnes(): void {
370371
*
371372
* @return void
372373
*/
373-
#[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions]
374+
#[DoesNotPerformAssertions]
374375
public function testAllowExtensionsSingleMatch(): void {
375376
$request = $this->Controller->getRequest();
376377
$request = $request->withParam('_ext', 'csv');

tests/TestCase/Controller/ShuntRequestControllerTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
use Cake\Core\Configure;
66
use Cake\TestSuite\IntegrationTestTrait;
7+
use PHPUnit\Framework\Attributes\UsesClass;
78
use RuntimeException;
89
use Shim\TestSuite\TestCase;
910
use Tools\Controller\ShuntRequestController;
1011

11-
#[\PHPUnit\Framework\Attributes\UsesClass(ShuntRequestController::class)]
12+
#[UsesClass(ShuntRequestController::class)]
1213
class ShuntRequestControllerTest extends TestCase {
1314

1415
use IntegrationTestTrait;

tests/TestCase/Model/Table/TableTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Cake\I18n\Time;
66
use Cake\Utility\Hash;
77
use DateTime as NativeDateTime;
8+
use DateTimeImmutable;
89
use Shim\TestSuite\TestCase;
910
use Tools\I18n\Date;
1011
use Tools\I18n\DateTime;
@@ -325,12 +326,12 @@ public function testValidateDate() {
325326

326327
// Test DateTimeInterface objects (e.g., DateTimeImmutable)
327328
$date = new DateTime('2010-02-25');
328-
$after = new \DateTimeImmutable('2010-02-24');
329+
$after = new DateTimeImmutable('2010-02-24');
329330
$res = $this->Users->validateDate($date, ['after' => $after]);
330331
$this->assertTrue($res);
331332

332333
$date = new Date('2010-02-24');
333-
$before = new \DateTimeImmutable('2010-02-25');
334+
$before = new DateTimeImmutable('2010-02-25');
334335
$res = $this->Users->validateDate($date, ['before' => $before]);
335336
$this->assertTrue($res);
336337

@@ -548,12 +549,12 @@ public function testValidateDatetime() {
548549

549550
// Test DateTimeInterface objects (e.g., DateTimeImmutable)
550551
$date = new DateTime('2010-02-25 14:30:00');
551-
$after = new \DateTimeImmutable('2010-02-25 14:29:00');
552+
$after = new DateTimeImmutable('2010-02-25 14:29:00');
552553
$res = $this->Users->validateDatetime($date, ['after' => $after]);
553554
$this->assertTrue($res);
554555

555556
$date = new DateTime('2010-02-25 14:30:00');
556-
$before = new \DateTimeImmutable('2010-02-25 14:31:00');
557+
$before = new DateTimeImmutable('2010-02-25 14:31:00');
557558
$res = $this->Users->validateDatetime($date, ['before' => $before]);
558559
$this->assertTrue($res);
559560

tests/TestCase/Utility/ClockTest.php

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

33
namespace Tools\Test\TestCase\Utility;
44

5+
use PHPUnit\Framework\Attributes\CoversClass;
56
use Shim\TestSuite\TestCase;
67
use Tools\Utility\Clock;
78

8-
#[\PHPUnit\Framework\Attributes\CoversClass(Clock::class)]
9+
#[CoversClass(Clock::class)]
910
class ClockTest extends TestCase {
1011

1112
/**

tests/TestCase/Utility/UtilityTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44

55
use Cake\Core\Configure;
66
use Cake\Core\Plugin;
7+
use PHPUnit\Framework\Attributes\CoversClass;
78
use RuntimeException;
89
use Shim\TestSuite\TestCase;
910
use Tools\Utility\Utility;
1011

11-
#[\PHPUnit\Framework\Attributes\CoversClass(Utility::class)]
12+
#[CoversClass(Utility::class)]
1213
class UtilityTest extends TestCase {
1314

1415
/**

0 commit comments

Comments
 (0)