Skip to content

Commit 9e588fe

Browse files
committed
Merge branch '3.8.x' into 4.0.x
* 3.8.x: Bump CI workflows (#6323) Make all mapped database types case insensitive (#6321)
2 parents 12bed06 + db922ba commit 9e588fe

File tree

6 files changed

+51
-16
lines changed

6 files changed

+51
-16
lines changed

.github/workflows/coding-standards.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ on:
2525
jobs:
2626
coding-standards:
2727
name: "Coding Standards"
28-
uses: "doctrine/.github/.github/workflows/coding-standards.yml@3.1.0"
28+
uses: "doctrine/.github/.github/workflows/coding-standards.yml@4.0.0"

.github/workflows/continuous-integration.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ jobs:
8787
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
8888

8989
- name: "Upload coverage file"
90-
uses: "actions/upload-artifact@v3"
90+
uses: "actions/upload-artifact@v4"
9191
with:
92-
name: "phpunit-${{ matrix.extension }}-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
92+
name: "phpunit-${{ matrix.extension }}-${{ matrix.dependencies }}-${{ matrix.php-version }}.coverage"
9393
path: "coverage.xml"
9494

9595
phpunit-oci8:
@@ -144,9 +144,9 @@ jobs:
144144
run: "vendor/bin/phpunit -c ci/github/phpunit/oci8${{ matrix.oracle-version < 23 && '-21' || '' }}.xml --coverage-clover=coverage.xml"
145145

146146
- name: "Upload coverage file"
147-
uses: "actions/upload-artifact@v3"
147+
uses: "actions/upload-artifact@v4"
148148
with:
149-
name: "${{ github.job }}-${{ matrix.php-version }}.coverage"
149+
name: "${{ github.job }}-${{ matrix.php-version }}-${{ matrix.oracle-version }}.coverage"
150150
path: "coverage.xml"
151151

152152
phpunit-pdo-oci:
@@ -201,9 +201,9 @@ jobs:
201201
run: "vendor/bin/phpunit -c ci/github/phpunit/pdo_oci${{ matrix.oracle-version < 23 && '-21' || '' }}.xml --coverage-clover=coverage.xml"
202202

203203
- name: "Upload coverage file"
204-
uses: "actions/upload-artifact@v3"
204+
uses: "actions/upload-artifact@v4"
205205
with:
206-
name: "${{ github.job }}-${{ matrix.php-version }}.coverage"
206+
name: "${{ github.job }}-${{ matrix.php-version }}-${{ matrix.oracle-version }}.coverage"
207207
path: "coverage.xml"
208208

209209
phpunit-postgres:
@@ -265,7 +265,7 @@ jobs:
265265
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
266266

267267
- name: "Upload coverage file"
268-
uses: "actions/upload-artifact@v3"
268+
uses: "actions/upload-artifact@v4"
269269
with:
270270
name: "${{ github.job }}-${{ matrix.postgres-version }}-${{ matrix.extension }}-${{ matrix.php-version }}.coverage"
271271
path: "coverage.xml"
@@ -334,7 +334,7 @@ jobs:
334334
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
335335

336336
- name: "Upload coverage file"
337-
uses: "actions/upload-artifact@v3"
337+
uses: "actions/upload-artifact@v4"
338338
with:
339339
name: "${{ github.job }}-${{ matrix.mariadb-version }}-${{ matrix.extension }}-${{ matrix.php-version }}.coverage"
340340
path: "coverage.xml"
@@ -409,7 +409,7 @@ jobs:
409409
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}${{ matrix.config-file-suffix }}.xml --coverage-clover=coverage.xml"
410410

411411
- name: "Upload coverage file"
412-
uses: "actions/upload-artifact@v3"
412+
uses: "actions/upload-artifact@v4"
413413
with:
414414
name: "${{ github.job }}-${{ matrix.mysql-version }}-${{ matrix.extension }}-${{ matrix.config-file-suffix }}-${{ matrix.php-version }}.coverage"
415415
path: "coverage.xml"
@@ -476,7 +476,7 @@ jobs:
476476
run: "vendor/bin/phpunit -c ci/github/phpunit/${{ matrix.extension }}.xml --coverage-clover=coverage.xml"
477477

478478
- name: "Upload coverage file"
479-
uses: "actions/upload-artifact@v3"
479+
uses: "actions/upload-artifact@v4"
480480
with:
481481
name: "${{ github.job }}-${{ matrix.extension }}-${{ matrix.php-version }}-${{ matrix.collation }}.coverage"
482482
path: "coverage.xml"
@@ -547,7 +547,7 @@ jobs:
547547
run: "vendor/bin/phpunit -c ci/github/phpunit/ibm_db2.xml --coverage-clover=coverage.xml"
548548

549549
- name: "Upload coverage file"
550-
uses: "actions/upload-artifact@v3"
550+
uses: "actions/upload-artifact@v4"
551551
with:
552552
name: "${{ github.job }}-${{ matrix.php-version }}.coverage"
553553
path: "coverage.xml"
@@ -601,7 +601,7 @@ jobs:
601601
fetch-depth: 2
602602

603603
- name: "Download coverage files"
604-
uses: "actions/download-artifact@v3"
604+
uses: "actions/download-artifact@v4"
605605
with:
606606
path: "reports"
607607

.github/workflows/stale.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
stale:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/stale@v6
10+
- uses: actions/stale@v9
1111
with:
1212
stale-pr-message: >
1313
There hasn't been any activity on this pull request in the past 90 days, so

.github/workflows/static-analysis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
strategy:
3535
matrix:
3636
php-version:
37-
- "8.2"
37+
- "8.3"
3838

3939
steps:
4040
- name: "Checkout code"
@@ -60,7 +60,7 @@ jobs:
6060
strategy:
6161
matrix:
6262
php-version:
63-
- "8.2"
63+
- "8.3"
6464

6565
steps:
6666
- name: Checkout code

src/Platforms/AbstractPlatform.php

+1
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ private function initializeAllDoctrineTypeMappings(): void
131131

132132
foreach (Type::getTypesMap() as $typeName => $className) {
133133
foreach (Type::getType($typeName)->getMappedDatabaseTypes($this) as $dbType) {
134+
$dbType = strtolower($dbType);
134135
$this->doctrineTypeMapping[$dbType] = $typeName;
135136
}
136137
}

tests/Platforms/AbstractPlatformTestCase.php

+34
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,40 @@ public function testRegisterDoctrineMappingType(): void
8585
self::assertEquals(Types::INTEGER, $this->platform->getDoctrineTypeMapping('foo'));
8686
}
8787

88+
public function testCaseInsensitiveDoctrineTypeMappingFromType(): void
89+
{
90+
$type = new class () extends Type {
91+
/**
92+
* {@inheritDoc}
93+
*/
94+
public function getMappedDatabaseTypes(AbstractPlatform $platform): array
95+
{
96+
return ['TESTTYPE'];
97+
}
98+
99+
public function getName(): string
100+
{
101+
return 'testtype';
102+
}
103+
104+
/**
105+
* {@inheritDoc}
106+
*/
107+
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
108+
{
109+
return $platform->getDecimalTypeDeclarationSQL($column);
110+
}
111+
};
112+
113+
if (Type::hasType($type->getName())) {
114+
Type::overrideType($type->getName(), $type::class);
115+
} else {
116+
Type::addType($type->getName(), $type::class);
117+
}
118+
119+
self::assertSame($type->getName(), $this->platform->getDoctrineTypeMapping('TeStTyPe'));
120+
}
121+
88122
public function testRegisterUnknownDoctrineMappingType(): void
89123
{
90124
$this->expectException(Exception::class);

0 commit comments

Comments
 (0)