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

Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment() #3501

Merged
merged 1 commit into from
Apr 13, 2019

Conversation

morozov
Copy link
Member

@morozov morozov commented Mar 29, 2019

Q A
Type improvement
BC Break yes

Currently, AbstractSchemaManager::extractDoctrineTypeFromComment() and ::removeDoctrineTypeFromComment() have to be called separately, one after the other, and duplicate implementation, however they are parts of a single whole: extracting a Doctrine type from the column comment.

The fact that the former requires passing $currentType makes it hard to use when the type is not yet known (see SqliteSchemaManager) and hard to guess if the type was actually extracted (it takes passing a knowingly wrong type and compare it with the result).

The proposed implementation makes the usage more straightforward. I would like to keep testExtractDoctrineTypeFromComment in place but I don't think the method is worth extraction into a separate class. Therefore, reflection is used in the test.

It's still unclear to me whether column comments should be nullable or not in general (I'd love them to not be), but making a decision requires a larger effort which will be made later. It's actually not being currently changed.

@morozov morozov changed the title Reworked AbstractSchemaManager::extractDoctrineTypeFromComment() removed ::removeDoctrineTypeFromComment() Reworked AbstractSchemaManager::extractDoctrineTypeFromComment() removed ::removeDoctrineTypeFromComment() Mar 29, 2019
@morozov morozov changed the title Reworked AbstractSchemaManager::extractDoctrineTypeFromComment() removed ::removeDoctrineTypeFromComment() Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment() Mar 29, 2019
@morozov morozov force-pushed the extract-type-from-comment branch 3 times, most recently from 735b62d to 2650cd3 Compare April 3, 2019 23:54
@morozov
Copy link
Member Author

morozov commented Apr 6, 2019

@Ocramius, @Majkl578 while I understand your arguments, I don't find them sufficient for blocking the change or changing the proposed API. Let's move on, please.

@Majkl578
Copy link
Contributor

Hmm, I'm not a native speaker so my perception of this may be wrong. I don't really have anything else to say except the naming.

@morozov morozov merged commit 09565d5 into doctrine:develop Apr 13, 2019
@morozov morozov deleted the extract-type-from-comment branch April 13, 2019 15:59
@Ocramius Ocramius added this to the 3.0.0 milestone Apr 13, 2019
morozov added a commit that referenced this pull request Apr 16, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit that referenced this pull request May 6, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit that referenced this pull request May 23, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit to morozov/dbal that referenced this pull request May 31, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit to morozov/dbal that referenced this pull request May 31, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit that referenced this pull request Jun 13, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit that referenced this pull request Jun 27, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit that referenced this pull request Jun 27, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit that referenced this pull request Jun 27, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit to morozov/dbal that referenced this pull request Aug 26, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit to morozov/dbal that referenced this pull request Aug 27, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
morozov added a commit that referenced this pull request Nov 2, 2019
Reworked AbstractSchemaManager::extractDoctrineTypeFromComment(), removed ::removeDoctrineTypeFromComment()
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2022
@morozov morozov removed this from the 4.0.0 milestone Aug 11, 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.

4 participants