ZEF Expression Language – Our first open source contribution
As we already mentioned, we plan to open source our core Convoworks library and make it available for other integrations. Managing an open source project is not a joke. There are whole lot things to cover expect development of some uber-cool new feature that everybody are waiting for. That’s why we decided to test-run and learn the whole process by extracting small reusable chunk as a standalone library and publish it on Github and Packagist.
The first thing is that with it you can evaluate non existing values. Instead of throwing the exception in such case, now it will just evaluate missing value to null and evaluate the rest of expression.
The second improvement is not that much critical. It just gives you ability to use some shorthand syntax.
- myarr[‘name’] === myarr.name
There is also shorthand when referencing object getters:
- myobj.getName() === myobj.name
- myobj.isValid() === myobj.valid
- myobj.hasAny() === myobj.any
The both improvements are inspired with Java Unified Expression Language behavior.