Coder Social home page Coder Social logo

Comments (10)

soullivaneuh avatar soullivaneuh commented on May 18, 2024

Feel free to make a PR. 👍

With concrete samples, before / after etc...

from sonataintlbundle.

ste93cry avatar ste93cry commented on May 18, 2024

I think this PR will be break compatibility for sure because it introduces a new parameter in all Twig filters. Is this ok? We could add the parameter to the end of the list instead of before the locale argument, but it wouldn't be so nice.

public function formatDecimal($number, array $attributes = array(), array $textAttributes = array(), $locale = null)

would be

public function formatDecimal($number, array $attributes = array(), array $textAttributes = array(), symbolAttributes = array(), $locale = null)

from sonataintlbundle.

soullivaneuh avatar soullivaneuh commented on May 18, 2024

Yes I understand the local.

Maybe we could find another way to keep bc like a new method with old one deprecation.

If not, this feature will be for next major version.

In any case, any PR is welcome.

from sonataintlbundle.

ste93cry avatar ste93cry commented on May 18, 2024

I will try to work on a PR (I already overridden a few classes to support this feature in my project) when I have some spare time, but I'm not an expert of PRs so be patient. About using a new method, I'm not sure it would be a good solution because there would be two filters for each formatter that differs only in parameters. I saw Symfony couting the number of args in some cases to maintain BC break while attending a new major version. Maybe we could do the same?

from sonataintlbundle.

soullivaneuh avatar soullivaneuh commented on May 18, 2024

I saw Symfony couting the number of args in some cases to maintain BC break while attending a new major version. Maybe we could do the same?

I'm curious. Could you provide a code sample link of this?

from sonataintlbundle.

ste93cry avatar ste93cry commented on May 18, 2024

Here it is. As you can see from the comment, they use the func_num_args function to support different function signatures and keep the compatibility with older versions.

from sonataintlbundle.

soullivaneuh avatar soullivaneuh commented on May 18, 2024

Seems to be a good alternative, let's try it.

from sonataintlbundle.

ste93cry avatar ste93cry commented on May 18, 2024

I've submitted a PR, although I noticed a few things that I have to fix before merging. Btw, if you want to do a code review and tell me what you think about how I tried to manage the BC it would be great

from sonataintlbundle.

OskarStark avatar OskarStark commented on May 18, 2024

@ste93cry would be good if you could prefix your PR with [WIP] if you work on it

thank you! 👍

from sonataintlbundle.

ste93cry avatar ste93cry commented on May 18, 2024

@rande I don't want to sound rude, but can you please check my PR and eventually approve/disapprove it?

from sonataintlbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.