Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I saw a vendor-bin directory in a few projects and I asked me why there needed? I can add dev requirements to my composer.json and actually I would say, the composer.json in your root directory is the place for psalm etc. Why also add another directory with a extra composer.json?
Probably the best answer to your question is to use an established "ORM" (Object Relational Mapping). Doctrine ( https://www.doctrine-project.org/ ) is a very popular one. Those libraries have already solved many of the problems you're going to run into.
phpstan has some strictness rules which, at a glance, can cover this: https://github.com/phpstan/phpstan-strict-rules/blob/1.2.x/README.md