Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 3.3.x into 3.4.x #5540

Merged
merged 6 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/lock-closed-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lock Closed Issues

on:
schedule:
- cron: 0 0 * * *

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
with:
github-token: '${{ github.token }}'
issue-inactive-days: 30
issue-comment: >
This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"require-dev": {
"doctrine/coding-standard": "9.0.0",
"jetbrains/phpstorm-stubs": "2022.1",
"phpstan/phpstan": "1.7.15",
"phpstan/phpstan-strict-rules": "^1.2",
"phpstan/phpstan": "1.8.2",
"phpstan/phpstan-strict-rules": "^1.3",
"phpunit/phpunit": "9.5.21",
"psalm/plugin-phpunit": "0.17.0",
"squizlabs/php_codesniffer": "3.7.1",
Expand Down
5 changes: 0 additions & 5 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ parameters:
# some drivers actually do accept 2nd parameter...
- '~^Method Doctrine\\DBAL\\Platforms\\AbstractPlatform::getListTableForeignKeysSQL\(\) invoked with \d+ parameters, 1 required\.\z~'

# https://github.com/phpstan/phpstan/issues/3134
-
message: '~^Call to static method PHPUnit\\Framework\\Assert::assertSame\(\) with Doctrine\\DBAL\\Types\\Type and Doctrine\\DBAL\\Types\\Type will always evaluate to true\.$~'
path: tests/Types/TypeRegistryTest.php

# https://github.com/phpstan/phpstan-strict-rules/issues/103
-
message: '~^Construct empty\(\) is not allowed. Use more strict comparison\.~'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Tests\FunctionalTestCase;

use function count;

final class NewPrimaryKeyWithNewAutoIncrementColumnTest extends FunctionalTestCase
{
protected function setUp(): void
Expand Down Expand Up @@ -63,7 +61,7 @@ public function testAlterPrimaryKeyToAutoIncrementColumn(callable $comparatorFac
self::assertTrue($validationTable->hasColumn('new_id'));
self::assertTrue($validationTable->getColumn('new_id')->getAutoincrement());
self::assertTrue($validationTable->hasPrimaryKey());
self::assertEquals(1, count($validationTable->getPrimaryKeyColumns()));
self::assertCount(1, $validationTable->getPrimaryKeyColumns());
self::assertArrayHasKey('new_id', $validationTable->getPrimaryKeyColumns());
}

Expand Down
26 changes: 13 additions & 13 deletions tests/Functional/Schema/SchemaManagerFunctionalTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public function testListTableIndexes(): void

$tableIndexes = $this->schemaManager->listTableIndexes('list_table_indexes_test');

self::assertEquals(3, count($tableIndexes));
self::assertCount(3, $tableIndexes);

self::assertArrayHasKey('primary', $tableIndexes, 'listTableIndexes() has to return a "primary" array key.');
self::assertEquals(['id', 'other_id'], array_map('strtolower', $tableIndexes['primary']->getColumns()));
Expand Down Expand Up @@ -513,7 +513,7 @@ public function testCreateTableWithForeignKeys(): void

$fkTable = $this->schemaManager->listTableDetails('test_create_fk');
$fkConstraints = $fkTable->getForeignKeys();
self::assertEquals(1, count($fkConstraints), "Table 'test_create_fk1' has to have one foreign key.");
self::assertCount(1, $fkConstraints, "Table 'test_create_fk' has to have one foreign key.");

$fkConstraint = current($fkConstraints);
self::assertInstanceOf(ForeignKeyConstraint::class, $fkConstraint);
Expand Down Expand Up @@ -545,7 +545,7 @@ public function testListForeignKeys(): void

$fkeys = $this->schemaManager->listTableForeignKeys('test_create_fk1');

self::assertEquals(1, count($fkeys), "Table 'test_create_fk1' has to have one foreign key.");
self::assertCount(1, $fkeys, "Table 'test_create_fk1' has to have one foreign key.");

self::assertInstanceOf(ForeignKeyConstraint::class, $fkeys[0]);
self::assertEquals(['foreign_key_test'], array_map('strtolower', $fkeys[0]->getLocalColumns()));
Expand Down Expand Up @@ -613,8 +613,8 @@ public function testAlterTableScenario(): void
self::assertTrue($table->hasColumn('id'));
self::assertTrue($table->hasColumn('test'));
self::assertTrue($table->hasColumn('foreign_key_test'));
self::assertEquals(0, count($table->getForeignKeys()));
self::assertEquals(1, count($table->getIndexes()));
self::assertCount(0, $table->getForeignKeys());
self::assertCount(1, $table->getIndexes());

$tableDiff = new TableDiff('alter_table');
$tableDiff->fromTable = $alterTable;
Expand All @@ -634,7 +634,7 @@ public function testAlterTableScenario(): void
$this->schemaManager->alterTable($tableDiff);

$table = $this->schemaManager->listTableDetails('alter_table');
self::assertEquals(2, count($table->getIndexes()));
self::assertCount(2, $table->getIndexes());
self::assertTrue($table->hasIndex('foo_idx'));
self::assertEquals(['foo'], array_map('strtolower', $table->getIndex('foo_idx')->getColumns()));
self::assertFalse($table->getIndex('foo_idx')->isPrimary());
Expand All @@ -647,7 +647,7 @@ public function testAlterTableScenario(): void
$this->schemaManager->alterTable($tableDiff);

$table = $this->schemaManager->listTableDetails('alter_table');
self::assertEquals(2, count($table->getIndexes()));
self::assertCount(2, $table->getIndexes());
self::assertTrue($table->hasIndex('foo_idx'));
self::assertEquals(
['foo', 'foreign_key_test'],
Expand All @@ -661,7 +661,7 @@ public function testAlterTableScenario(): void
$this->schemaManager->alterTable($tableDiff);

$table = $this->schemaManager->listTableDetails('alter_table');
self::assertEquals(2, count($table->getIndexes()));
self::assertCount(2, $table->getIndexes());
self::assertTrue($table->hasIndex('bar_idx'));
self::assertFalse($table->hasIndex('foo_idx'));
self::assertEquals(
Expand Down Expand Up @@ -900,7 +900,7 @@ public function testGetColumnComment(): void
$this->schemaManager->createTable($table);

$columns = $this->schemaManager->listTableColumns('column_comment_test');
self::assertEquals(1, count($columns));
self::assertCount(1, $columns);
self::assertEquals('This is a comment', $columns['id']->getComment());

$tableDiff = new TableDiff('column_comment_test');
Expand All @@ -922,7 +922,7 @@ public function testGetColumnComment(): void
$this->schemaManager->alterTable($tableDiff);

$columns = $this->schemaManager->listTableColumns('column_comment_test');
self::assertEquals(1, count($columns));
self::assertCount(1, $columns);
self::assertEmpty($columns['id']->getComment());
}

Expand All @@ -947,7 +947,7 @@ public function testAutomaticallyAppendCommentOnMarkedColumns(): void
$this->schemaManager->createTable($table);

$columns = $this->schemaManager->listTableColumns('column_comment_test2');
self::assertEquals(3, count($columns));
self::assertCount(3, $columns);
self::assertEquals('This is a comment', $columns['id']->getComment());
self::assertEquals('This is a comment', $columns['obj']->getComment());
self::assertInstanceOf(ObjectType::class, $columns['obj']->getType());
Expand Down Expand Up @@ -975,7 +975,7 @@ public function testCommentHintOnDateIntervalTypeColumn(): void
$this->schemaManager->createTable($table);

$columns = $this->schemaManager->listTableColumns('column_dateinterval_comment');
self::assertEquals(2, count($columns));
self::assertCount(2, $columns);
self::assertEquals('This is a comment', $columns['id']->getComment());
self::assertEquals('This is a comment', $columns['date_interval']->getComment());
self::assertInstanceOf(DateIntervalType::class, $columns['date_interval']->getType());
Expand Down Expand Up @@ -1110,7 +1110,7 @@ public function testListForeignKeysComposite(): void

$fkeys = $this->schemaManager->listTableForeignKeys('test_create_fk3');

self::assertEquals(1, count($fkeys), "Table 'test_create_fk3' has to have one foreign key.");
self::assertCount(1, $fkeys, "Table 'test_create_fk3' has to have one foreign key.");

self::assertInstanceOf(ForeignKeyConstraint::class, $fkeys[0]);
self::assertEquals(['id', 'foreign_key_test'], array_map('strtolower', $fkeys[0]->getLocalColumns()));
Expand Down