PHP Ecosystem is migrating from Annotations to Attributes. TDBM will follow this migration in the next major release, a rough plan is laid out below.
Annotations to attributes
The general idea is to store attributes (instead of annotations) in database comments (columns[methods] / tables[classes]).
We are okay to treat any comment line starting with #[ as an expected php attribute. We could also imagine that we stick to the @ in database. Serialization of the attribute content could work as-is in \TheCodingMachine\FluidSchema\Comment::addAnnotation
Providing a migration script for existing database comments is not in scope, but we may share one.
thecodingmachine/tdbm
Relevant parts of the code:
\TheCodingMachine\TDBM\Utils\ForeignKeyAnalyzerTrait::getAnnotations (and callers)
Potential blockers:
thecodingmachine/tdbm-fluid-schema-builder
TODO
Relevant parts of the code:
\TheCodingMachine\FluidSchema\Comment
thecodingmachine/tdbm-graphql
TODO
PHP Ecosystem is migrating from Annotations to Attributes. TDBM will follow this migration in the next major release, a rough plan is laid out below.
Annotations to attributes
The general idea is to store attributes (instead of annotations) in database comments (columns[methods] / tables[classes]).
We are okay to treat any comment line starting with
#[as an expected php attribute. We could also imagine that we stick to the@in database. Serialization of the attribute content could work as-is in\TheCodingMachine\FluidSchema\Comment::addAnnotationProviding a migration script for existing database comments is not in scope, but we may share one.
thecodingmachine/tdbm\TheCodingMachine\TDBM\Utils\Annotation\AddInterface(and the like) to attributes\TheCodingMachine\TDBM\Utils\Annotation\AnnotationParserto parse attributeseval+ reflection: the generation process is rather scoped, that should do the tricknikic/PHP-parserorroave/better-reflection: ideally we would avoid relying on external library for thisRelevant parts of the code:
\TheCodingMachine\TDBM\Utils\ForeignKeyAnalyzerTrait::getAnnotations(and callers)Potential blockers:
thecodingmachine/tdbm-fluid-schema-builderTODO
Relevant parts of the code:
\TheCodingMachine\FluidSchema\Commentthecodingmachine/tdbm-graphqlTODO