cocur / slugify

Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.
MIT License
2.89k stars 252 forks source link

Make Twig Bridge compatible with Twig 3.0 #236

Closed mhujer closed 5 years ago

mhujer commented 5 years ago

Twig provides namespaced class aliases since 1.38.1 and 2.12.1, so this should work on all recently released Twig versions.

florianeckerstorfer commented 5 years ago

Awesome, could you update the PR with the latest changes from master and see if the tests pass?

mhujer commented 5 years ago

@florianeckerstorfer rebased, but the build is failing for <PHP7.0 probably because of the conflict rule. I spent some time trying to figure it out, but without success.

Either the conflict rule can be removed, or the support for long-dead PHP versions can be dropped.

kubawerlos commented 5 years ago

@mhujer the conflict you have added - <1.38.1||<2.12.1 works like this:

We can go 2 ways:

mhujer commented 5 years ago

@kubawerlos thanks for pointing that out! I didn't occur to me before.

I fixed it by specifying the ranges with lower band:

    "conflict": {
        "twig/twig": ">=1,<1.38.1|>=2,<2.12.1"
    },

(got inspiration from https://github.com/Roave/SecurityAdvisories/blob/master/composer.json - they have quite a few conflict rules there).

florianeckerstorfer commented 5 years ago

I have absolutely no knowledge about the conflict rules in Composer, @kubawerlos do you think this is fine now?

kubawerlos commented 5 years ago

@florianeckerstorfer looks fine