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

Skip to content

[Routing] Better inline requirements and defaults parsing #40755

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
Apr 11, 2021

Conversation

Foxprodev
Copy link
Contributor

@Foxprodev Foxprodev commented Apr 9, 2021

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #40749 #40701
License MIT
Doc PR

Remove ! symbol from requirements and defaults array keys in Route class. Leave ! symbol in Route compiled path for correct token creation.
The only restriction I found:
Important variable can't get default value, only in UrlGenerator.
As mentioned in

// variable is optional when it is not important and has a default value

they are not optional

Feel free to help me with some advice. Thank you in advance

@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 5.x 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

@derrabus
Copy link
Member

derrabus commented Apr 9, 2021

Thank you for your PR, @Foxprodev! I haven't reviewed your changes yet, but I noticed that you're about to submit a bugfix against the 5.x branch. Please note that we usually fix bugs on the lowest maintained branch that suffers from the bug. We currently maintain the branches 4.4 and 5.2, so if the bug is present there, please target one of those branches instead.

@derrabus derrabus added this to the 5.x milestone Apr 9, 2021
@Foxprodev
Copy link
Contributor Author

Foxprodev commented Apr 9, 2021

@derrabus Thanks, it makes sense. Well, I am going to test with 4.4 and rework branch according 4.4 version then 😞

@Foxprodev Foxprodev changed the base branch from 5.x to 4.4 April 9, 2021 19:47
@derrabus derrabus modified the milestones: 5.x, 4.4 Apr 9, 2021
Copy link
Contributor Author

@Foxprodev Foxprodev left a comment

Choose a reason for hiding this comment

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

Done. No idea how to restart checks. Maybe an empty commit or amend?

Remove ! symbol from requirements and defaults array keys in Route class. Leave ! symbol in Route compiled path for correct token creation
Added some inline route settings tests
@nicolas-grekas
Copy link
Member

Thank you @Foxprodev.

@nicolas-grekas nicolas-grekas merged commit 7ce1dda into symfony:4.4 Apr 11, 2021
This was referenced May 1, 2021
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.

[Routing] Router ignores inline requirements of important param
4 participants