Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DoctrineBridge] Add NAME const for UID types #46642

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

Merged
merged 1 commit into from
Jul 20, 2022
Merged

[DoctrineBridge] Add NAME const for UID types #46642

merged 1 commit into from
Jul 20, 2022

Conversation

marcelsiegert
Copy link
Contributor

@marcelsiegert marcelsiegert commented Jun 11, 2022

Q A
Branch? 6.2
Bug fix? no
New feature? yes
Deprecations? no
Tickets
License MIT
Doc PR symfony/symfony-docs#16866

This allows to refer to the constant instead of an "arbitrary" string. For example:

#[ORM\Column(type: UuidType::NAME)]
private $foo;

Doctrine already does it this way in its documentation.

The name of the constant is taken from the already existing Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineFooType class, where a constant with a similar purpose already exists (albeit this one is private). Another possibility would be UlidType::ULID and UuidType::UUID as shown in Doctrine's Custom Mapping Types documentation.

This allows to refer to the constant instead of an "arbitrary" string.
For example:

#[ORM\Column(type: UuidType::NAME)]
private $foo;

Doctrine already does it this way in its documentation.

The name of the constant is taken from the already existing
`Symfony\Bridge\Doctrine\Tests\PropertyInfo\Fixtures\DoctrineFooType`
class, where a constant with a similar purpose already exists (albeit
this one is `private`).
@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.2 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@carsonbot
Copy link

Hey!

I think @AndreasA has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@AndreasA
Copy link
Contributor

@marcelsiegert Not really sure why I got mentioned, The last thing I did was adjust the unique entity validator. It is part of the doctrine bridge but it wasn't really related to UUID or ULID types.

But I can take a look though, bu I cannot approve it anyway.

@chalasr
Copy link
Member

chalasr commented Jun 13, 2022

@AndreasA Looks like it's because you updated the DoctrineBridge CHANGELOG at some point 🤦‍♂️ Carsonbot should probably skip .md files when looking for potential reviewers.

@AndreasA
Copy link
Contributor

AndreasA commented Jun 13, 2022

@chalasr Ah. Yes, it would probably make sense to skip those.
But even if I would review it, someone else would need to approve it anyway, so carsonbot should probably also add at least one reviewer that could approve/merge the PR in addition as well.

@chalasr
Copy link
Member

chalasr commented Jun 13, 2022

You should be able to approve the PR. It's probably not looking green like project member approvals but it still matters to us, especially if the bot requested your review as it should mean you have some knowledge in this area (otherwise you can just excuse Carson for the noise and ignore them)

@AndreasA
Copy link
Contributor

AndreasA commented Jun 13, 2022

@chalasr ah. yes I just see it now. It was at a different position than I expected, I seldom had to approve PRs on GitHub, mostly gitlab. as I already reviewed it, it is fine. But as you mentioned I was actually only mentioned due the changelog entry 😄

Copy link
Contributor

@AndreasA AndreasA left a comment

Choose a reason for hiding this comment

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

except for the comments. though maybe a Symfony member can check those if they are indeed relevant as they are not that important to the functionality.

@fabpot
Copy link
Member

fabpot commented Jul 20, 2022

Thank you @marcelsiegert.

@fabpot fabpot merged commit e6b8029 into symfony:6.2 Jul 20, 2022
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request Aug 11, 2022
This PR was merged into the 6.2 branch.

Discussion
----------

Add `NAME` const for UID types

Documentation update for symfony/symfony#46642.

Commits
-------

5cc7135 [DoctrineBridge] Add `NAME` const for UID types
@fabpot fabpot mentioned this pull request Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants