php-cypher-dsl
php-cypher-dsl copied to clipboard
Use static functions instead of a trait for casts
Currently, cast methods are inserted into a class using the CastTrait trait. This has a few problems:
- It requires an additional
usestatement which can get left behind after refactoring; - It clutters up the private interface;
- It does not allow casts to be used outside classes.
The trait should instead be written as an abstract class with final static functions, that can then be used throughout the project. Because all casts are currently private functions, this does not have impact on backwards compatibility.