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

Bump cs libs #3983

Merged
merged 10 commits into from
May 4, 2020
Merged

Bump cs libs #3983

merged 10 commits into from
May 4, 2020

Conversation

greg0ire
Copy link
Member

@greg0ire greg0ire commented May 2, 2020

Q A
Type improvement
BC Break no
Fixed issues n/a

Summary

Using the latest coding style should make #3977 a lot easier

@greg0ire greg0ire force-pushed the bump-cs-libs branch 2 times, most recently from 2d70fc8 to 08487f6 Compare May 2, 2020 13:46
@greg0ire greg0ire requested a review from morozov May 2, 2020 14:21
@greg0ire greg0ire mentioned this pull request May 2, 2020
16 tasks
phpcs.xml.dist Show resolved Hide resolved
phpcs.xml.dist Outdated Show resolved Hide resolved
phpcs.xml.dist Outdated Show resolved Hide resolved
lib/Doctrine/DBAL/SQLParserUtils.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/Driver/StatementIteratorTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/ConnectionTest.php Outdated Show resolved Hide resolved
Copy link
Member

@morozov morozov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's double-check all the newly introduced assert(). Many of them look redundant.

lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php Outdated Show resolved Hide resolved
lib/Doctrine/DBAL/Schema/Table.php Outdated Show resolved Hide resolved
phpcs.xml.dist Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/ConnectionTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/Driver/StatementIteratorTest.php Outdated Show resolved Hide resolved
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php Outdated Show resolved Hide resolved
foreach ($this->constraints as $fkConstraint) {
assert($fkConstraint instanceof ForeignKeyConstraint);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessarily for now, but would it be possible to document the property as SplObjectStorage<ForeignKeyConstraint> and avoid runtime assertions? I may have tried earlier but not sure.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documenting it as SplObjectStorage<ForeignKeyConstraint, Table> makes Psalm happy, but Phpstan gives the following error: PHPDoc tag @var for property Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector::$constraints contains unresolvable type.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, it might be something like SplObjectStorage&Iterable<ForeignKeyConstraint>.

phpcs.xml.dist Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/ConnectionTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/ConnectionTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/DBALExceptionTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/DBALExceptionTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/DBALExceptionTest.php Outdated Show resolved Hide resolved
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php Outdated Show resolved Hide resolved
@morozov
Copy link
Member

morozov commented May 4, 2020

Looks good, @greg0ire 👍 Please group/squash the commits.

@greg0ire
Copy link
Member Author

greg0ire commented May 4, 2020

Done! Down from 16 to 10 commits

@greg0ire greg0ire merged commit 4c03ed8 into doctrine:2.10.x May 4, 2020
@greg0ire greg0ire deleted the bump-cs-libs branch May 4, 2020 06:45
@greg0ire
Copy link
Member Author

greg0ire commented May 4, 2020

I'm ignoring Scrutinizer on this one! Thanks @morozov for your review!

@greg0ire greg0ire added this to the 2.10.3 milestone Jun 7, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants