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

Improved support for symfony3 #614

Merged
merged 1 commit into from
Aug 16, 2016

Conversation

core23
Copy link
Member

@core23 core23 commented Aug 13, 2016

I am targetting this branch, because…

Changelog

### Changed
 - Use class names for filters when using symfony 2.8+

Subject

This will reduce some deprecation warnings and supports the new class usage for forms.

break;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe use an inflected here?

Copy link
Contributor

Choose a reason for hiding this comment

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

Inflector damn autocorrect

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you please elaborate?

Copy link
Contributor

Choose a reason for hiding this comment

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

There are classes to convert snake case to camel case and so on. Doctrine inflector or maybe sf has its own class

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if we can improve this with an inflector class. We can't convert everything from snake to camel case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Then maybe use an associative array type => class?

@@ -66,7 +66,12 @@ public function getDefaultOptions()
*/
public function getRenderSettings()
{
return array('sonata_type_filter_default', array(
// NEXT_MAJOR: Remove this line when drop Symfony <2.8 support
$type = method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')
Copy link
Member

Choose a reason for hiding this comment

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

can we move this to a method in abstract class Filter extends BaseFilter ?

in this case we avoid code duplication for the default stuff

Copy link
Member Author

Choose a reason for hiding this comment

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

👎 Introducing a method only for BC handling is a bad idea

cc @soullivaneuh

Copy link
Member

Choose a reason for hiding this comment

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

ok, fine for me

lets merge this as it is

@OskarStark
Copy link
Member

Thank you @core23 👍

@OskarStark OskarStark merged commit b6d9a60 into sonata-project:3.x Aug 16, 2016
@core23 core23 deleted the patch/symfony3-forms branch August 16, 2016 08:16
@soullivaneuh
Copy link
Member

This is not a minor but a patch.

@soullivaneuh soullivaneuh added patch and removed minor labels Sep 12, 2016
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.

None yet

5 participants