Don’t compromise stability over a single feature. Just use strictly typed constructor and setters. Mark your PHPDocs so you can go back and apply the types after it is released.
You should look into a producer/consumer messaging pattern, instead of constantly querying the database for new records. The process in charge of writing to the database can also produce a message (into a service bus) that a consumer picks up and performs the desired operation upon receipt. This will help with scalability.
We maintain server code all the way back since 2002. We ran into a problem with our internal global "Error" class, which did not exist prior to PHP 7 and needed to be renamed or namespaced.
Don’t compromise stability over a single feature. Just use strictly typed constructor and setters. Mark your PHPDocs so you can go back and apply the types after it is released.
You should look into a producer/consumer messaging pattern, instead of constantly querying the database for new records. The process in charge of writing to the database can also produce a message (into a service bus) that a consumer picks up and performs the desired operation upon receipt. This will help with scalability.
Why not use OpenAPI Specification/Swagger?
We maintain server code all the way back since 2002. We ran into a problem with our internal global "Error" class, which did not exist prior to PHP 7 and needed to be renamed or namespaced.
You can write OpenAPI in JSON