diff --git a/core/lib/Drupal/Core/Config/TypedConfigManager.php b/core/lib/Drupal/Core/Config/TypedConfigManager.php index 929fa5b..8b95728 100644 --- a/core/lib/Drupal/Core/Config/TypedConfigManager.php +++ b/core/lib/Drupal/Core/Config/TypedConfigManager.php @@ -72,13 +72,7 @@ protected function getDiscovery() { /** - * Gets typed configuration data. - * - * @param string $name - * Configuration object name. - * - * @return \Drupal\Core\Config\Schema\TypedConfigInterface - * Typed configuration data. + * {@inheritdoc} */ public function get($name) { $data = $this->configStorage->read($name); diff --git a/core/lib/Drupal/Core/TypedData/TypedDataManager.php b/core/lib/Drupal/Core/TypedData/TypedDataManager.php index 6e8e575..51d1e38 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataManager.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataManager.php @@ -139,59 +139,14 @@ public function createListDataDefinition($item_type) { } /** - * Implements \Drupal\Component\Plugin\PluginManagerInterface::getInstance(). - * - * @param array $options - * An array of options with the following keys: - * - object: The parent typed data object, implementing the - * TypedDataInterface and either the ListInterface or the - * ComplexDataInterface. - * - property: The name of the property to instantiate, or the delta of the - * the list item to instantiate. - * - value: The value to set. If set, it has to match one of the supported - * data type formats as documented by the data type classes. - * - * @throws \InvalidArgumentException - * If the given property is not known, or the passed object does not - * implement the ListInterface or the ComplexDataInterface. - * - * @return \Drupal\Core\TypedData\TypedDataInterface - * The new property instance. - * - * @see \Drupal\Core\TypedData\TypedDataManager::getPropertyInstance() + * {@inheritdoc} */ public function getInstance(array $options) { return $this->getPropertyInstance($options['object'], $options['property'], $options['value']); } /** - * Get a typed data instance for a property of a given typed data object. - * - * This method will use prototyping for fast and efficient instantiation of - * many property objects with the same property path; e.g., - * when multiple comments are used comment_body.0.value needs to be - * instantiated very often. - * Prototyping is done by the root object's data type and the given - * property path, i.e. all property instances having the same property path - * and inheriting from the same data type are prototyped. - * - * @param \Drupal\Core\TypedData\TypedDataInterface $object - * The parent typed data object, implementing the TypedDataInterface and - * either the ListInterface or the ComplexDataInterface. - * @param string $property_name - * The name of the property to instantiate, or the delta of an list item. - * @param mixed $value - * (optional) The data value. If set, it has to match one of the supported - * data type formats as documented by the data type classes. - * - * @throws \InvalidArgumentException - * If the given property is not known, or the passed object does not - * implement the ListInterface or the ComplexDataInterface. - * - * @return \Drupal\Core\TypedData\TypedDataInterface - * The new property instance. - * - * @see \Drupal\Core\TypedData\TypedDataManager::create() + * {@inheritdoc} */ public function getPropertyInstance(TypedDataInterface $object, $property_name, $value = NULL) { // For performance, try to reuse existing prototypes instead of diff --git a/core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php b/core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php index 85c54dc..58bba2c 100644 --- a/core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php +++ b/core/lib/Drupal/Core/TypedData/TypedDataManagerInterface.php @@ -18,7 +18,7 @@ Interface TypedDataManagerInterface extends PluginManagerInterface, CachedDiscoveryInterface { /** - * Instantiates a typed data object. + * {@inheritdoc} * * @param string $data_type * The data type, for which a typed object should be instantiated. @@ -106,6 +106,30 @@ public function createDataDefinition($data_type); public function createListDataDefinition($item_type); /** + * {@inheritdoc} + * + * @param array $options + * An array of options with the following keys: + * - object: The parent typed data object, implementing the + * TypedDataInterface and either the ListInterface or the + * ComplexDataInterface. + * - property: The name of the property to instantiate, or the delta of the + * the list item to instantiate. + * - value: The value to set. If set, it has to match one of the supported + * data type formats as documented by the data type classes. + * + * @throws \InvalidArgumentException + * If the given property is not known, or the passed object does not + * implement the ListInterface or the ComplexDataInterface. + * + * @return \Drupal\Core\TypedData\TypedDataInterface + * The new property instance. + * + * @see \Drupal\Core\TypedData\TypedDataManager::getPropertyInstance() + */ + public function getInstance(array $options); + + /** * Get a typed data instance for a property of a given typed data object. * * This method will use prototyping for fast and efficient instantiation of @@ -137,6 +161,14 @@ public function createListDataDefinition($item_type); public function getPropertyInstance(TypedDataInterface $object, $property_name, $value = NULL); /** + * Gets the validator for validating typed data. + * + * @return \Symfony\Component\Validator\Validator\ValidatorInterface + * The validator object. + */ + public function getValidator(); + + /** * Sets the validator for validating typed data. * * @param \Symfony\Component\Validator\Validator\ValidatorInterface $validator @@ -145,12 +177,12 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name, public function setValidator(ValidatorInterface $validator); /** - * Gets the validator for validating typed data. + * Gets the validation constraint manager. * - * @return \Symfony\Component\Validator\Validator\ValidatorInterface - * The validator object. + * @return \Drupal\Core\Validation\ConstraintManager + * The constraint manager. */ - public function getValidator(); + public function getValidationConstraintManager(); /** * Sets the validation constraint manager. @@ -164,14 +196,6 @@ public function getValidator(); public function setValidationConstraintManager(ConstraintManager $constraintManager); /** - * Gets the validation constraint manager. - * - * @return \Drupal\Core\Validation\ConstraintManager - * The constraint manager. - */ - public function getValidationConstraintManager(); - - /** * Gets default constraints for the given data definition. * * This generates default constraint definitions based on the data definition;