php-cypher-dsl icon indicating copy to clipboard operation
php-cypher-dsl copied to clipboard

Use static functions instead of a trait for casts

Open marijnvanwezel opened this issue 2 years ago • 0 comments

Currently, cast methods are inserted into a class using the CastTrait trait. This has a few problems:

  • It requires an additional use statement 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.

marijnvanwezel avatar Feb 07 '23 22:02 marijnvanwezel