Skip to content

Commit 8174368

Browse files
chore: Update Composer QA tooling dependencies (#373)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
1 parent 9d267ad commit 8174368

38 files changed

+280
-548
lines changed

ci/rector/config.php

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@
99
use Rector\Set\ValueObject\LevelSetList;
1010
use Rector\Set\ValueObject\SetList;
1111

12-
return static function (RectorConfig $rectorConfig): void {
13-
$basePath = __DIR__.'/../../';
14-
$paths = [
12+
$basePath = __DIR__.'/../../';
13+
14+
return RectorConfig::configure()
15+
->withPaths([
1516
$basePath.'ci',
1617
$basePath.'fixtures',
1718
$basePath.'src',
1819
$basePath.'tests',
19-
];
20-
$rectorConfig->paths($paths);
21-
22-
$rectorConfig->cacheDirectory($basePath.'var/cache/rector/');
23-
24-
$rectorConfig->parallel();
25-
$rectorConfig->phpstanConfig($basePath.'ci/phpstan/config.neon');
26-
27-
$rectorConfig->sets([
20+
])
21+
->withCache($basePath.'var/cache/rector/')
22+
->withParallel()
23+
->withPHPStanConfigs([$basePath.'ci/phpstan/config.neon'])
24+
->withComposerBased(
25+
doctrine: true,
26+
phpunit: true,
27+
)
28+
->withSets([
2829
SetList::CODE_QUALITY,
2930
SetList::DEAD_CODE,
3031
SetList::EARLY_RETURN,
@@ -34,18 +35,18 @@
3435
SetList::TYPE_DECLARATION,
3536
SetList::PRIVATIZATION,
3637
SetList::CODING_STYLE,
37-
DoctrineSetList::DOCTRINE_ORM_25,
3838
DoctrineSetList::DOCTRINE_CODE_QUALITY,
3939
LevelSetList::UP_TO_PHP_81,
40-
]);
41-
42-
$rectorConfig->skip([
40+
])
41+
->withSkip([
4342
RenamePropertyToMatchTypeRector::class,
4443
FlipTypeControlToUseExclusiveTypeRector::class => [
4544
$basePath.'src/MartinGeorgiev/Utils/DoctrineLexer.php',
4645
],
47-
]);
48-
49-
$rectorConfig->importShortClasses(false);
50-
$rectorConfig->importNames(false, false);
51-
};
46+
])
47+
->withImportNames(
48+
importNames: false,
49+
importDocBlockNames: false,
50+
importShortClasses: false,
51+
removeUnusedImports: true,
52+
);

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
"doctrine/orm": "~2.14||~3.0",
4949
"ekino/phpstan-banned-code": "^3.0",
5050
"friendsofphp/php-cs-fixer": "^3.75.0",
51-
"phpstan/phpstan": "^2.1.13",
51+
"phpstan/phpstan": "^2.1.14",
5252
"phpstan/phpstan-deprecation-rules": "^2.0.2",
53-
"phpstan/phpstan-doctrine": "^2.0.2",
53+
"phpstan/phpstan-doctrine": "^2.0.3",
5454
"phpstan/phpstan-phpunit": "^2.0.6",
55-
"phpunit/phpunit": "^10.5.45",
56-
"rector/rector": "^2.0.14",
55+
"phpunit/phpunit": "^10.5.46",
56+
"rector/rector": "^2.0.15",
5757
"symfony/cache": "^6.4||^7.0"
5858
},
5959
"suggest": {

tests/Integration/MartinGeorgiev/Doctrine/DBAL/Types/DBALTypesIntegrationTest.php

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

77
use Doctrine\DBAL\Types\Type;
88
use MartinGeorgiev\Doctrine\DBAL\Types\ValueObject\Point as PointValueObject;
9+
use PHPUnit\Framework\Attributes\DataProvider;
910

1011
class DBALTypesIntegrationTest extends IntegrationTestCase
1112
{
12-
/**
13-
* @dataProvider provideScalarTypeTestCases
14-
*/
13+
#[DataProvider('provideScalarTypeTestCases')]
1514
public function test_scalar_type(string $typeName, string $columnType, mixed $testValue): void
1615
{
1716
$tableName = 'test_'.\str_replace(['[', ']', ' '], ['', '', '_'], $typeName);
@@ -67,9 +66,7 @@ public static function provideScalarTypeTestCases(): array
6766
];
6867
}
6968

70-
/**
71-
* @dataProvider provideArrayTypeTestCases
72-
*/
69+
#[DataProvider('provideArrayTypeTestCases')]
7370
public function test_array_type(string $typeName, string $columnType, array $testValue): void
7471
{
7572
$tableName = 'test_'.\str_replace(['[', ']', ' '], ['', '', '_'], $typeName);
@@ -131,9 +128,7 @@ public static function provideArrayTypeTestCases(): array
131128
];
132129
}
133130

134-
/**
135-
* @dataProvider provideJsonTypeTestCases
136-
*/
131+
#[DataProvider('provideJsonTypeTestCases')]
137132
public function test_json_type(string $typeName, string $columnType, array $testValue): void
138133
{
139134
$tableName = 'test_'.\str_replace(['[', ']', ' '], ['', '', '_'], $typeName);
@@ -192,9 +187,7 @@ public static function provideJsonTypeTestCases(): array
192187
];
193188
}
194189

195-
/**
196-
* @dataProvider providePointTypeTestCases
197-
*/
190+
#[DataProvider('providePointTypeTestCases')]
198191
public function test_point_type(string $typeName, string $columnType, PointValueObject $pointValueObject): void
199192
{
200193
$tableName = 'test_'.\str_replace(['[', ']', ' '], ['', '', '_'], $typeName);

tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/BaseArrayTest.php

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
use Doctrine\DBAL\Platforms\AbstractPlatform;
88
use Doctrine\DBAL\Types\ConversionException;
99
use MartinGeorgiev\Doctrine\DBAL\Types\BaseArray;
10+
use PHPUnit\Framework\Attributes\DataProvider;
11+
use PHPUnit\Framework\Attributes\Test;
1012
use PHPUnit\Framework\MockObject\MockObject;
1113
use PHPUnit\Framework\TestCase;
1214

@@ -32,11 +34,8 @@ protected function setUp(): void
3234
->getMock();
3335
}
3436

35-
/**
36-
* @test
37-
*
38-
* @dataProvider provideValidTransformations
39-
*/
37+
#[DataProvider('provideValidTransformations')]
38+
#[Test]
4039
public function can_transform_from_php_value(?array $phpValue, ?string $postgresValue): void
4140
{
4241
$this->fixture
@@ -46,11 +45,8 @@ public function can_transform_from_php_value(?array $phpValue, ?string $postgres
4645
self::assertSame($postgresValue, $this->fixture->convertToDatabaseValue($phpValue, $this->platform));
4746
}
4847

49-
/**
50-
* @test
51-
*
52-
* @dataProvider provideValidTransformations
53-
*/
48+
#[DataProvider('provideValidTransformations')]
49+
#[Test]
5450
public function can_transform_to_php_value(?array $phpValue, ?string $postgresValue): void
5551
{
5652
self::assertEquals($phpValue, $this->fixture->convertToPHPValue($postgresValue, $this->platform));
@@ -80,9 +76,7 @@ public static function provideValidTransformations(): array
8076
];
8177
}
8278

83-
/**
84-
* @test
85-
*/
79+
#[Test]
8680
public function throws_invalid_argument_exception_when_php_value_is_not_array(): void
8781
{
8882
$this->expectException(\InvalidArgumentException::class);
@@ -91,9 +85,7 @@ public function throws_invalid_argument_exception_when_php_value_is_not_array():
9185
$this->fixture->convertToDatabaseValue('invalid-php-value-type', $this->platform);
9286
}
9387

94-
/**
95-
* @test
96-
*/
88+
#[Test]
9789
public function throws_domain_exception_when_invalid_array_item_value(): void
9890
{
9991
$this->expectException(ConversionException::class);
@@ -107,9 +99,7 @@ public function throws_domain_exception_when_invalid_array_item_value(): void
10799
$this->fixture->convertToDatabaseValue([0], $this->platform);
108100
}
109101

110-
/**
111-
* @test
112-
*/
102+
#[Test]
113103
public function throws_domain_exception_when_postgres_value_is_not_valid_php_array(): void
114104
{
115105
$this->expectException(ConversionException::class);

tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/BaseFloatArrayTestCase.php

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66

77
use Doctrine\DBAL\Types\ConversionException;
88
use MartinGeorgiev\Doctrine\DBAL\Types\BaseFloatArray;
9+
use PHPUnit\Framework\Attributes\DataProvider;
10+
use PHPUnit\Framework\Attributes\Test;
911
use PHPUnit\Framework\TestCase;
1012

1113
abstract class BaseFloatArrayTestCase extends TestCase
1214
{
1315
protected BaseFloatArray $fixture;
1416

15-
/**
16-
* @test
17-
*
18-
* @dataProvider provideInvalidPHPValuesForDatabaseTransformation
19-
*/
17+
#[DataProvider('provideInvalidPHPValuesForDatabaseTransformation')]
18+
#[Test]
2019
public function can_detect_invalid_for_transformation_php_value(mixed $phpValue): void
2120
{
2221
self::assertFalse($this->fixture->isValidArrayItemForDatabase($phpValue));
@@ -40,21 +39,15 @@ public static function provideInvalidPHPValuesForDatabaseTransformation(): array
4039
];
4140
}
4241

43-
/**
44-
* @test
45-
*
46-
* @dataProvider provideValidTransformations
47-
*/
42+
#[DataProvider('provideValidTransformations')]
43+
#[Test]
4844
public function can_transform_from_php_value(float $phpValue, string $postgresValue): void
4945
{
5046
self::assertTrue($this->fixture->isValidArrayItemForDatabase($phpValue));
5147
}
5248

53-
/**
54-
* @test
55-
*
56-
* @dataProvider provideValidTransformations
57-
*/
49+
#[DataProvider('provideValidTransformations')]
50+
#[Test]
5851
public function can_transform_to_php_value(float $phpValue, string $postgresValue): void
5952
{
6053
self::assertEquals($phpValue, $this->fixture->transformArrayItemForPHP($postgresValue));
@@ -68,9 +61,7 @@ public function can_transform_to_php_value(float $phpValue, string $postgresValu
6861
*/
6962
abstract public static function provideValidTransformations(): array;
7063

71-
/**
72-
* @test
73-
*/
64+
#[Test]
7465
public function throws_domain_exception_when_invalid_array_item_value(): void
7566
{
7667
$this->expectException(ConversionException::class);

tests/Unit/MartinGeorgiev/Doctrine/DBAL/Types/BaseIntegerArrayTestCase.php

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66

77
use MartinGeorgiev\Doctrine\DBAL\Types\BaseIntegerArray;
88
use MartinGeorgiev\Doctrine\DBAL\Types\Exceptions\InvalidIntegerArrayItemForPHPException;
9+
use PHPUnit\Framework\Attributes\DataProvider;
10+
use PHPUnit\Framework\Attributes\Test;
911
use PHPUnit\Framework\TestCase;
1012

1113
abstract class BaseIntegerArrayTestCase extends TestCase
1214
{
1315
protected BaseIntegerArray $fixture;
1416

15-
/**
16-
* @test
17-
*
18-
* @dataProvider provideInvalidPHPValuesForDatabaseTransformation
19-
*/
17+
#[DataProvider('provideInvalidPHPValuesForDatabaseTransformation')]
18+
#[Test]
2019
public function can_detect_invalid_for_transformation_php_value(mixed $phpValue): void
2120
{
2221
self::assertFalse($this->fixture->isValidArrayItemForDatabase($phpValue));
@@ -41,21 +40,15 @@ public static function provideInvalidPHPValuesForDatabaseTransformation(): array
4140
];
4241
}
4342

44-
/**
45-
* @test
46-
*
47-
* @dataProvider provideValidTransformations
48-
*/
43+
#[DataProvider('provideValidTransformations')]
44+
#[Test]
4945
public function can_transform_from_php_value(int $phpValue, string $postgresValue): void
5046
{
5147
self::assertTrue($this->fixture->isValidArrayItemForDatabase($phpValue));
5248
}
5349

54-
/**
55-
* @test
56-
*
57-
* @dataProvider provideValidTransformations
58-
*/
50+
#[DataProvider('provideValidTransformations')]
51+
#[Test]
5952
public function can_transform_to_php_value(int $phpValue, string $postgresValue): void
6053
{
6154
self::assertEquals($phpValue, $this->fixture->transformArrayItemForPHP($postgresValue));
@@ -69,11 +62,8 @@ public function can_transform_to_php_value(int $phpValue, string $postgresValue)
6962
*/
7063
abstract public static function provideValidTransformations(): array;
7164

72-
/**
73-
* @test
74-
*
75-
* @dataProvider provideOutOfRangeValues
76-
*/
65+
#[DataProvider('provideOutOfRangeValues')]
66+
#[Test]
7767
public function throws_domain_exception_when_value_exceeds_range(string $outOfRangeValue): void
7868
{
7969
$this->expectException(InvalidIntegerArrayItemForPHPException::class);

0 commit comments

Comments
 (0)