Skip to content

Pass option by_reference in case we're using AdminType#1142

Merged
VincentLanglet merged 1 commit into
sonata-project:3.xfrom
VincentLanglet:formContractor
Oct 8, 2020
Merged

Pass option by_reference in case we're using AdminType#1142
VincentLanglet merged 1 commit into
sonata-project:3.xfrom
VincentLanglet:formContractor

Conversation

@VincentLanglet
Copy link
Copy Markdown
Member

@VincentLanglet VincentLanglet commented Oct 4, 2020

Subject

I am targeting this branch, because BC.

Related to sonata-project/SonataAdminBundle#6438
Then I'll need a release to add a conflict on SonataAdmin.

Changelog

### Added
- `FormContractor::getDefaultOptions()` now pass `by_reference` from `CollectionType` to `AdminType`

@VincentLanglet
Copy link
Copy Markdown
Member Author

Please review @sonata-project/contributors

Copy link
Copy Markdown
Member

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@VincentLanglet VincentLanglet requested a review from a team October 8, 2020 07:07
public function getDefaultOptions($type, FieldDescriptionInterface $fieldDescription)
{
// NEXT_MAJOR: Remove this line and update the function signature.
$formOptions = \func_get_args()[2] ?? [];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add phpdoc for the new parameter? Maybe use @phpstan-param if the php-cs-fixer removes this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@core23 The phpdoc is inherited from the interface getDefaultOptions.

I prefer to add the phpdoc in the interface in the SonataAdmin PR https://github.com/sonata-project/SonataAdminBundle/pull/6438/files

@VincentLanglet VincentLanglet requested a review from core23 October 8, 2020 14:25
@VincentLanglet VincentLanglet merged commit b07bdcf into sonata-project:3.x Oct 8, 2020
@VincentLanglet VincentLanglet deleted the formContractor branch October 8, 2020 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants