Skip to content

Commit 8f6c630

Browse files
committed
refactor: apply rector rules
1 parent ca870ef commit 8f6c630

25 files changed

+89
-173
lines changed

src/Bridge/Telescope/TelescopeLogger.php

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

1111
class TelescopeLogger implements LoggerInterface
1212
{
13-
private LoggerInterface $parentLogger;
13+
private readonly LoggerInterface $parentLogger;
1414

1515
public function __construct($parentLogger)
1616
{

tests/app/Entities/Footprint.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515

1616
final class Footprint implements JsonSerializable, Stringable
1717
{
18-
private UserId $id;
18+
private readonly UserId $id;
1919

20-
private string $party;
20+
private readonly string $party;
2121

22-
private string $realm;
22+
private readonly string $realm;
2323

2424
public static function empty(string $authorizedParty = 'guest-party', string $realm = 'guest-realm'): self
2525
{

tests/app/Entities/Post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class Post
1818
public int $id;
1919

2020
#[Column(type: 'string')]
21-
private string $title;
21+
private readonly string $title;
2222

2323
#[Column(type: 'text')]
24-
private string $description;
24+
private readonly string $description;
2525

2626
#[Column(type: 'datetime', nullable: true)]
2727
private ?DateTimeImmutable $deletedAt = null;

tests/app/Entities/UserId.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
final class UserId implements Stringable
1111
{
12-
private string $id;
12+
private readonly string $id;
1313

1414
public static function create(string $userId): self
1515
{

tests/src/Bridge/Laravel/Console/Commands/Database/ListCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
use Cycle\Database\Database;
88
use Cycle\Database\DatabaseInterface;
99
use Illuminate\Support\Facades\Artisan;
10+
use PHPUnit\Framework\Attributes\Test;
1011
use WayOfDev\Tests\TestCase;
1112

1213
class ListCommandTest extends TestCase
1314
{
14-
/**
15-
* @test
16-
*/
15+
#[Test]
1716
public function it_runs_handle(): void
1817
{
1918
/** @var Database $database */

tests/src/Bridge/Laravel/Console/Commands/Database/TableCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
use Cycle\Database\Database;
88
use Cycle\Database\DatabaseInterface;
99
use Illuminate\Support\Facades\Artisan;
10+
use PHPUnit\Framework\Attributes\Test;
1011
use WayOfDev\Tests\TestCase;
1112

1213
class TableCommandTest extends TestCase
1314
{
14-
/**
15-
* @test
16-
*/
15+
#[Test]
1716
public function it_runs_handle(): void
1817
{
1918
/** @var Database $database */

tests/src/Bridge/Laravel/Console/Commands/Migrations/InitCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
use Cycle\Database\Database;
88
use Cycle\Database\DatabaseInterface;
9+
use PHPUnit\Framework\Attributes\Test;
910
use WayOfDev\Tests\TestCase;
1011

1112
class InitCommandTest extends TestCase
1213
{
13-
/**
14-
* @test
15-
*/
14+
#[Test]
1615
public function it_runs_handle(): void
1716
{
1817
/** @var Database $database */

tests/src/Bridge/Laravel/Console/Commands/Migrations/MigrateCommandTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
use Cycle\Database\Database;
88
use Cycle\Database\DatabaseInterface;
9+
use PHPUnit\Framework\Attributes\Test;
910
use WayOfDev\Tests\TestCase;
1011

1112
class MigrateCommandTest extends TestCase
1213
{
13-
/**
14-
* @test
15-
*/
14+
#[Test]
1615
public function it_migrates_in_safe_environment(): void
1716
{
1817
/** @var Database $database */
@@ -27,9 +26,7 @@ public function it_migrates_in_safe_environment(): void
2726
$this::assertCount(1, $database->getTables());
2827
}
2928

30-
/**
31-
* @test
32-
*/
29+
#[Test]
3330
public function it_migrates_in_production_with_force_option(): void
3431
{
3532
// Set the application environment to production
@@ -50,9 +47,7 @@ public function it_migrates_in_production_with_force_option(): void
5047
$this::assertCount(4, $database->getTables());
5148
}
5249

53-
/**
54-
* @test
55-
*/
50+
#[Test]
5651
public function it_warns_about_unsafe_migrations(): void
5752
{
5853
// Set the application environment to production

tests/src/Bridge/Laravel/Console/Commands/Migrations/ReplayCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
use Cycle\Database\Database;
88
use Cycle\Database\DatabaseInterface;
9+
use PHPUnit\Framework\Attributes\Test;
910
use WayOfDev\Tests\TestCase;
1011

1112
class ReplayCommandTest extends TestCase
1213
{
13-
/**
14-
* @test
15-
*/
14+
#[Test]
1615
public function it_runs_handle(): void
1716
{
1817
/** @var Database $database */

tests/src/Bridge/Laravel/Console/Commands/Migrations/RollbackCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
use Cycle\Database\Database;
88
use Cycle\Database\DatabaseInterface;
9+
use PHPUnit\Framework\Attributes\Test;
910
use WayOfDev\Tests\TestCase;
1011

1112
class RollbackCommandTest extends TestCase
1213
{
13-
/**
14-
* @test
15-
*/
14+
#[Test]
1615
public function it_runs_handle(): void
1716
{
1817
/** @var Database $database */

tests/src/Bridge/Laravel/Console/Commands/Migrations/StatusCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
use Cycle\Database\Database;
88
use Cycle\Database\DatabaseInterface;
99
use Illuminate\Support\Facades\Artisan;
10+
use PHPUnit\Framework\Attributes\Test;
1011
use WayOfDev\Tests\TestCase;
1112

1213
class StatusCommandTest extends TestCase
1314
{
14-
/**
15-
* @test
16-
*/
15+
#[Test]
1716
public function it_runs_handle(): void
1817
{
1918
/** @var Database $database */

tests/src/Bridge/Laravel/Console/Commands/ORM/MigrateCommandTest.php

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Cycle\ORM\SchemaInterface;
88
use Illuminate\Support\Facades\File;
9+
use PHPUnit\Framework\Attributes\Test;
910
use Psr\Container\ContainerExceptionInterface;
1011
use Psr\Container\NotFoundExceptionInterface;
1112
use WayOfDev\Cycle\Contracts\CacheManager;
@@ -34,9 +35,7 @@ protected function setUp(): void
3435
File::delete(__DIR__ . '/../../../../../../app/Entities/Tag.php');
3536
}
3637

37-
/**
38-
* @test
39-
*/
38+
#[Test]
4039
public function it_runs_migrate(): void
4140
{
4241
$this->assertConsoleCommandOutputContainsStrings('cycle:orm:migrate', ['-n' => true], self::USER_MIGRATION);
@@ -46,9 +45,7 @@ public function it_runs_migrate(): void
4645
]);
4746
}
4847

49-
/**
50-
* @test
51-
*/
48+
#[Test]
5249
public function it_runs_migrate_with_no_changes(): void
5350
{
5451
$this->artisanCall('cycle:orm:migrate', ['-n' => true]);
@@ -58,9 +55,7 @@ public function it_runs_migrate_with_no_changes(): void
5855
$this->assertConsoleCommandOutputContainsStrings('cycle:orm:migrate', [], 'No database changes');
5956
}
6057

61-
/**
62-
* @test
63-
*/
58+
#[Test]
6459
public function it_creates_migration_when_entity_appeared(): void
6560
{
6661
$this->assertConsoleCommandOutputContainsStrings('cycle:orm:migrate', ['-r' => true], self::USER_MIGRATION);
@@ -98,11 +93,10 @@ class Tag
9893
}
9994

10095
/**
101-
* @test
102-
*
10396
* @throws ContainerExceptionInterface
10497
* @throws NotFoundExceptionInterface
10598
*/
99+
#[Test]
106100
public function it_passes_schema_defaults_to_compiler(): void
107101
{
108102
config()->set('cycle.schema.defaults', [

tests/src/Bridge/Laravel/Console/Commands/ORM/RenderCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
use Cycle\ORM\Parser\Typecast;
88
use Cycle\ORM\SchemaInterface;
9+
use PHPUnit\Framework\Attributes\Test;
910
use WayOfDev\Tests\TestCase;
1011

1112
class RenderCommandTest extends TestCase
1213
{
13-
/**
14-
* @test
15-
*/
14+
#[Test]
1615
public function it_runs_handle(): void
1716
{
1817
$this->assertConsoleCommandOutputContainsStrings('cycle:orm:render', ['--no-color' => true], [

tests/src/Bridge/Laravel/Console/Commands/ORM/SyncCommandTest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66

77
use Cycle\ORM\EntityManager;
88
use Illuminate\Support\Facades\Artisan;
9+
use PHPUnit\Framework\Attributes\Test;
910
use Throwable;
1011
use WayOfDev\App\Entities\User;
1112
use WayOfDev\Tests\TestCase;
1213

1314
class SyncCommandTest extends TestCase
1415
{
1516
/**
16-
* @test
17-
*
1817
* @throws Throwable
1918
*/
19+
#[Test]
2020
public function it_runs_handle(): void
2121
{
2222
$this->artisanCall('cycle:orm:sync');
@@ -31,10 +31,9 @@ public function it_runs_handle(): void
3131
}
3232

3333
/**
34-
* @test
35-
*
3634
* @throws Throwable
3735
*/
36+
#[Test]
3837
public function it_runs_handle_in_debug_mode(): void
3938
{
4039
$this->assertConsoleCommandOutputContainsStrings('cycle:orm:sync', ['--verbose' => 3], [
@@ -50,9 +49,7 @@ public function it_runs_handle_in_debug_mode(): void
5049
$this::assertSame(1, $u->id);
5150
}
5251

53-
/**
54-
* @test
55-
*/
52+
#[Test]
5653
public function it_fails_in_production_without_force(): void
5754
{
5855
// Set the application environment to production

tests/src/Bridge/Laravel/Console/Commands/ORM/UpdateCommandTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
namespace WayOfDev\Tests\Bridge\Laravel\Console\Commands\ORM;
66

77
use Cycle\ORM\SchemaInterface;
8+
use PHPUnit\Framework\Attributes\Test;
89
use WayOfDev\App\Entities\User;
910
use WayOfDev\Tests\TestCase;
1011

1112
class UpdateCommandTest extends TestCase
1213
{
13-
/**
14-
* @test
15-
*/
14+
#[Test]
1615
public function it_runs_handle(): void
1716
{
1817
$this->artisanCall('cycle:orm');

tests/src/Bridge/Laravel/LoggerFactoryTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Illuminate\Log\LogManager;
1313
use Illuminate\Support\Facades\Event;
1414
use Mockery as m;
15+
use PHPUnit\Framework\Attributes\Test;
1516
use Psr\Container\ContainerExceptionInterface;
1617
use Psr\Container\NotFoundExceptionInterface;
1718
use Psr\Log\NullLogger;
@@ -31,11 +32,10 @@ protected function tearDown(): void
3132
}
3233

3334
/**
34-
* @test
35-
*
3635
* @throws ContainerExceptionInterface
3736
* @throws NotFoundExceptionInterface
3837
*/
38+
#[Test]
3939
public function it_should_return_custom_logger_from_factory(): void
4040
{
4141
$this->app['config']->set('cycle.database.logger.use_telescope', false);
@@ -58,11 +58,10 @@ public function it_should_return_custom_logger_from_factory(): void
5858
}
5959

6060
/**
61-
* @test
62-
*
6361
* @throws ContainerExceptionInterface
6462
* @throws NotFoundExceptionInterface
6563
*/
64+
#[Test]
6665
public function it_should_fire_query_executed_event_when_query_is_logged(): void
6766
{
6867
$this->app['config']->set('cycle.database.logger.use_telescope', true);
@@ -84,11 +83,10 @@ public function it_should_fire_query_executed_event_when_query_is_logged(): void
8483
}
8584

8685
/**
87-
* @test
88-
*
8986
* @throws ContainerExceptionInterface
9087
* @throws NotFoundExceptionInterface
9188
*/
89+
#[Test]
9290
public function it_should_return_null_logger_from_factory(): void
9391
{
9492
config()->set('cycle.database.logger', [

0 commit comments

Comments
 (0)