Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[DependencyInjection] Add support an integer return for default_index_method #40337

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
Mar 10, 2021
Merged

[DependencyInjection] Add support an integer return for default_index_method #40337

merged 1 commit into from
Mar 10, 2021

Conversation

maranqz
Copy link
Contributor

@maranqz maranqz commented Mar 1, 2021

Q A
Branch? 5.x for features
Bug fix? no
New feature? yes
Deprecations? no
Tickets #40319
License MIT
Doc PR TODO

@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

@maranqz
Copy link
Contributor Author

maranqz commented Mar 1, 2021

Should I put notice about this feature in docs ?

}

return $defaultIndex;
return (string) $rm->invoke(null);
Copy link
Member

Choose a reason for hiding this comment

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

I would not unconditionally cast to string here. that could have weird effects with other things than integers that you want to support here.

Copy link
Contributor Author

@maranqz maranqz Mar 1, 2021

Choose a reason for hiding this comment

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

if (\is_int($defaultIndex)){  // or \is_numeric?
    $defaultIndex = (string) $defaultIndex;
}
if (!\is_string($defaultIndex)) {
....

Is that better?

@derrabus derrabus added this to the 5.x milestone Mar 1, 2021
@carsonbot carsonbot changed the title Add support an integer return for default_index_method [DependencyInjection] Add support an integer return for default_index_method Mar 1, 2021
@maranqz
Copy link
Contributor Author

maranqz commented Mar 1, 2021

I do not understand how I should fix 7.4 tests.
Could you help me with?

image

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

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

Awesome!

Great feature, great implementation, great that you added both test and change log.
I like this. 👍

The test failures is not related to your PR so you can ignore them. Good thing that you checked.

I dont think this feature needs to be documented. It is almost as I think it should be a bugfix...

Let's see what some other maintainer think about adding docs or not.

@nicolas-grekas
Copy link
Member

Thank you @maranqz.

@nicolas-grekas nicolas-grekas merged commit a69bb1e into symfony:5.x Mar 10, 2021
@fabpot fabpot mentioned this pull request Apr 18, 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.

6 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.