The DataType annotation documents $constraints and points people to the getConstraints() method that no longer exists on TypedDataManager. In fact the $constraints property on data types does not seem to be used in core as data definitions are used to add and enforce constraints. TypedData::getConstraints uses its definition's constraints rather than any provided on the annotation.
TypedDataInterface::getConstraints only explains that it should get constraints, and how it is done is left to the implementation so it is possible that a data type could implement constraint getting from the annotation.
Current documentation:
/**
* An array of validation constraints for this type.
*
* @var array
*
* @see \Drupal\Core\TypedData\TypedDataManager::getConstraints().
*/
public $constraints;
This could be rolled into #2047119: Remove deprecated documentation in DataType annotation β , but unsure of the scope of that issue as it is a follow-up to #2002102: Move TypedData primitive types to interfaces β .
Need to decide approach to take.
N/A
Yes, If we deprecate $constraints property in the annotation, then it will be removed in a later version.
N/A
Active
11.0 π₯
Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.