neoxygen / neo4j-neoclient

Simple PHP HttpClient for the Neo4j ReST API with Multi DB Support
MIT License
121 stars 138 forks source link

Allow scalar node value for port #60

Closed pascaldevink closed 8 years ago

pascaldevink commented 9 years ago

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.

ikwattro commented 9 years ago

Without offense, I'm not ok for this kind of hack, for the simple reason that postponing the integer check is :

  1. removing all benefits of using a well defined Configuration object definition
  2. (int) 'lol' will be 0 which is a valid integer and will throw an error later in the process

Another 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.