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

Add $database parameter for methods: listTableIndexes, listTableDetails #4402

Closed
wants to merge 1 commit into from

Conversation

stdex
Copy link

@stdex stdex commented Nov 1, 2020

Q A
Type improvement
BC Break no
Fixed issues #3611

Summary

Rebase pull request: #885

@stdex stdex marked this pull request as ready for review November 4, 2020 08:49
Copy link
Member

@SenseException SenseException left a comment

Choose a reason for hiding this comment

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

Please also add ?string type to the added $database arguments instead of just the phpdocs.

If your commits aren't separated logical steps, please squash your commits into one or either give them a better message instead of using the same commit message for all 4 commits.

*/
public function listTableDetails($name)
public function listTableDetails($name, $database = null): Table
Copy link
Member

Choose a reason for hiding this comment

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

Adding a return type in a minor version is a BC break.

Suggested change
public function listTableDetails($name, $database = null): Table
public function listTableDetails($name, $database = null)

@@ -320,9 +320,9 @@ protected function _getPortableTableForeignKeysList($tableForeignKeys)
/**
* {@inheritdoc}
*/
public function listTableDetails($name)
public function listTableDetails($name, $database = null): Table
Copy link
Member

Choose a reason for hiding this comment

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

Adding a return type in a minor version is a BC break.

Suggested change
public function listTableDetails($name, $database = null): Table
public function listTableDetails($name, $database = null)

@stdex stdex reopened this Nov 7, 2020
*
* @return Index[]
*/
public function listTableIndexes($table)
public function listTableIndexes(string $table, ?string $database = null)
Copy link
Member

Choose a reason for hiding this comment

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

This is a BC-break for extending classes, I think you will have to resort to func_get_args if you want to make this BC.

Copy link
Member

@SenseException SenseException Nov 7, 2020

Choose a reason for hiding this comment

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

True, the second argument is a BC break. 😞

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.

Sorry, I thought I posted this 3 days ago but I didn't.

@@ -566,4 +571,136 @@ public function testParseNullCreateOptions(): void

self::assertEquals([], $table->getOption('create_options'));
}

public function testListTableIndexes2Db(): void
Copy link
Member

@morozov morozov Nov 5, 2020

Choose a reason for hiding this comment

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

This has to be tested with all platforms, not only MySQL which most likely will not work. There is some related work in progress: 3.0.x...morozov:issues/3826.

See the "Testing Different Database Platforms" section drafted in #4356.

@morozov morozov closed this Apr 21, 2021
@morozov morozov deleted the branch doctrine:2.12.x April 21, 2021 16:26
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants