Closed pascaldevink closed 8 years ago
Without offense, I'm not ok for this kind of hack, for the simple reason that postponing the integer check is :
(int) 'lol'
will be 0
which is a valid integer and will throw an error later in the processAnother point is, that even if I know jinja is doing weird things with variables types (even if you cast them in the jinja template), I don't have a reason to do hacky things in the current code because there is a bug in Jinja.
Using a scalar node as valid value for the port and later forcing the int value, making it possible to use strings in configuration. This behaviour is equal to the DoctrineBundle. That bundle uses the same strategy to allow scalar values. This benefits certain deployment styles.
For example, I'm currently using ansible and ansible-vault to set the parameters of my Symfony application. The templating ansible uses (jinja) is a little more strict and doesn't allow integer nodes.