Skip to content

Commit

Permalink
Merge branch '3.8.x' into 3.9.x
Browse files Browse the repository at this point in the history
* 3.8.x:
  PHPStan 1.11.5 (doctrine#6446)
  Revert "Merge pull request doctrine#6413 from achterin/bugfix/foreign_key_name_change_detection"
  CI: Update MariaDB versions (doctrine#6426)
  CI MariaDB: add 11.4, remove 11.0 (doctrine#6432)
  Fix typo in the portability documentation (doctrine#6430)
  • Loading branch information
derrabus committed Jun 18, 2024
2 parents df1bd13 + 032d902 commit 123d2f3
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 17 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ jobs:
- "10.5" # LTS (Jun 2025)
- "10.6" # LTS (Jul 2026)
- "10.11" # LTS (Feb 2028)
- "11.0" # STS (Jun 2024)
- "11.1" # STS (Aug 2024)
- "11.2" # STS (Nov 2024)
- "11.3" # STS (Feb 2025)
- "11.4" # LTS (May 2029)
extension:
- "mysqli"
- "pdo_mysql"
Expand All @@ -317,16 +317,16 @@ jobs:
mariadb-version: "10.6"
extension: "pdo_mysql"
- php-version: "8.2"
mariadb-version: "11.2"
mariadb-version: "11.4"
extension: "mysqli"
- php-version: "8.2"
mariadb-version: "11.2"
mariadb-version: "11.4"
extension: "pdo_mysql"
- php-version: "8.3"
mariadb-version: "11.2"
mariadb-version: "11.4"
extension: "mysqli"
- php-version: "8.3"
mariadb-version: "11.2"
mariadb-version: "11.4"
extension: "pdo_mysql"

services:
Expand All @@ -337,7 +337,7 @@ jobs:
MYSQL_DATABASE: "doctrine_tests"

options: >-
--health-cmd "mariadb-admin ping --silent || mysqladmin ping --silent"
--health-cmd "healthcheck.sh --connect --innodb_initialized || mysqladmin ping --protocol tcp --silent"
ports:
- "3306:3306"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"doctrine/coding-standard": "12.0.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2023.1",
"phpstan/phpstan": "1.11.1",
"phpstan/phpstan": "1.11.5",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "9.6.19",
"psalm/plugin-phpunit": "0.18.4",
Expand Down
2 changes: 1 addition & 1 deletion docs/en/reference/portability.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Using the following code block in your initialization will:
use Doctrine\DBAL\ColumnCase;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Portability\Connection as PortableConnection;
use Doctrine\DBAL\Portability\Middleware as PotableMiddleware;
use Doctrine\DBAL\Portability\Middleware as PortableMiddleware;
$configuration = new Configuration();
$configuration->setMiddlewares([
Expand Down
6 changes: 6 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,11 @@ parameters:
# Ignore the possible false return value of db2_num_rows().
- '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\Connection\:\:exec\(\) should return int but returns int<0, max>\|false\.$~'
- '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\Result\:\:rowCount\(\) should return int but returns int<0, max>\|false\.$~'

# This is a rather complicated closure setup. We understand this, so PHPStan doesn't have to.
-
message: '#^Parameter \#2 \$callback of function array_reduce expects callable\(\(callable&TIn\)\|Closure\(mixed \$value\)\: mixed\|null, callable\(T\)\: T\)\: \(\(callable&TIn\)\|Closure\(mixed \$value\)\: mixed\|null\), Closure\(callable\|null, callable\)\: \(callable\(T\)\: T\) given\.$#'
path: src/Portability/Converter.php

includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
4 changes: 0 additions & 4 deletions src/Schema/Comparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -555,10 +555,6 @@ private function detectRenamedIndexes(array &$addedIndexes, array &$removedIndex
*/
public function diffForeignKey(ForeignKeyConstraint $key1, ForeignKeyConstraint $key2)
{
if (strtolower($key1->getName()) !== strtolower($key2->getName())) {
return true;
}

if (
array_map('strtolower', $key1->getUnquotedLocalColumns())
!== array_map('strtolower', $key2->getUnquotedLocalColumns())
Expand Down
9 changes: 4 additions & 5 deletions tests/Schema/AbstractComparatorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ public function testCompareColumnCompareCaseInsensitive(): void
self::assertFalse($tableDiff);
}

public function testDetectIndexNameChange(): void
public function testCompareIndexBasedOnPropertiesNotName(): void
{
$tableA = new Table('foo');
$tableA->addColumn('id', Types::INTEGER);
Expand All @@ -672,7 +672,7 @@ public function testDetectIndexNameChange(): void
);
}

public function testDetectForeignKeyNameChange(): void
public function testCompareForeignKeyBasedOnPropertiesNotName(): void
{
$tableA = new Table('foo');
$tableA->addColumn('id', Types::INTEGER);
Expand All @@ -683,9 +683,8 @@ public function testDetectForeignKeyNameChange(): void
$tableB->addForeignKeyConstraint('bar', ['id'], ['id'], [], 'bar_constraint');

$tableDiff = $this->comparator->diffTable($tableA, $tableB);
self::assertNotFalse($tableDiff);
self::assertCount(1, $tableDiff->addedForeignKeys);
self::assertCount(1, $tableDiff->removedForeignKeys);

self::assertFalse($tableDiff);
}

public function testCompareForeignKeyRestrictNoActionAreTheSame(): void
Expand Down

0 comments on commit 123d2f3

Please sign in to comment.