diff --git a/core/lib/Drupal/Core/Entity/ContentEntityForm.php b/core/lib/Drupal/Core/Entity/ContentEntityForm.php index 765a4fc..a7858ed 100644 --- a/core/lib/Drupal/Core/Entity/ContentEntityForm.php +++ b/core/lib/Drupal/Core/Entity/ContentEntityForm.php @@ -104,7 +104,7 @@ public function validate(array $form, FormStateInterface $form_state) { * @param \Drupal\Core\Entity\EntityConstraintViolationListInterface $violations * The violations to flag. * @param array $form - * A nested array form elements comprising the form. + * A nested array of form elements comprising the form. * @param \Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php index 2d199bc..f161a37 100644 --- a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php +++ b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php @@ -245,6 +245,7 @@ public function validateFormValues(FieldableEntityInterface $entity, array &$for /** * Returns whether the field is editable. + * * @param array $form * The form * @param string $field_name @@ -272,9 +273,9 @@ public function flagViolations(EntityConstraintViolationListInterface $violation $widget->flagErrors($entity->get($field_name), $field_violations, $form, $form_state); } else { - // The field might not exist or the current user does not have access. As - // alternative for CompositeConstraintBase we try to put the value onto - // the first accessible field. + // The field might not exist or the current user does not have access. + // As alternative for CompositeConstraintBase we try to put the value + // onto the first accessible field. foreach ($field_violations as $violation) { if ($violation instanceof ConstraintViolation && $violation->getConstraint() instanceof CompositeConstraintBase && $covered_fields = $violation->getConstraint()->coversFields()) { foreach ($covered_fields as $covered_field) { @@ -302,14 +303,14 @@ public function flagViolations(EntityConstraintViolationListInterface $violation * The violations. * * @return \Symfony\Component\Validator\ConstraintViolationList - * A new constraint violation list with the changed propery path. + * A new constraint violation list with the changed property path. */ protected function movePropertyPathViolationsRelativeToField($field_name, ConstraintViolationListInterface $violations) { $new_violations = new ConstraintViolationList(); foreach ($violations as $violation) { - // All this code below is done in order to change the property path of the + // All the logic below is necessary to change the property path of the // violations to be relative to the item list, so like title.0.value gets - // changed to 0.value. Sadly constraints in symfony don't have setters so + // changed to 0.value. Sadly constraints in Symfony don't have setters so // we have to create new objects. /** @var \Symfony\Component\Validator\ConstraintViolationInterface $violation */ // Create a new violation object with just a different property path. diff --git a/core/modules/comment/src/CommentForm.php b/core/modules/comment/src/CommentForm.php index 6e811a4..293a95a 100644 --- a/core/modules/comment/src/CommentForm.php +++ b/core/modules/comment/src/CommentForm.php @@ -316,7 +316,7 @@ public function buildEntity(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ protected function flagViolations(EntityConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state) { - // Customly flag violations of fields not handled by the form display. + // Manually flag violations of fields not handled by the form display. foreach ($violations->filterByField('created') as $violation) { $form_state->setErrorByName('date', $violation->getMessage()); } diff --git a/core/modules/system/src/Tests/Entity/FieldWidgetConstraintValidatorTest.php b/core/modules/system/src/Tests/Entity/FieldWidgetConstraintValidatorTest.php index 4fa7fbb..5994ac2 100644 --- a/core/modules/system/src/Tests/Entity/FieldWidgetConstraintValidatorTest.php +++ b/core/modules/system/src/Tests/Entity/FieldWidgetConstraintValidatorTest.php @@ -99,7 +99,7 @@ protected function getErrorsForEntity(EntityInterface $entity, $hidden_fields = /** * Tests widget constraint validation with composite constraints. */ - public function testValidationWIthCompositeConstraint() { + public function testValidationWithCompositeConstraint() { // First provide a valid value, this should cause no validation. $entity = EntityTestCompositeConstraint::create([ 'name' => 'valid-value', @@ -110,7 +110,7 @@ public function testValidationWIthCompositeConstraint() { $this->assertFalse(isset($errors['name'])); $this->assertFalse(isset($errors['type'])); - // Provide an invalidate value for the name field. + // Provide an invalid value for the name field. $entity = EntityTestCompositeConstraint::create([ 'name' => 'failure-field-name', ]); @@ -129,7 +129,7 @@ public function testValidationWIthCompositeConstraint() { // Provide a violation again, but this time hide the first field (name). // Ensure that the validation still happens and the error message is moved - // from the field field to the second field and have a custom error message. + // from the field to the second field and have a custom error message. $entity = EntityTestCompositeConstraint::create([ 'name' => 'failure-field-name', ]); diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php index 82183ce..d455a98 100644 --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -360,7 +360,7 @@ public function buildEntity(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ protected function flagViolations(EntityConstraintViolationListInterface $violations, array $form, FormStateInterface $form_state) { - // Customly flag violations of fields not handled by the form display. This + // Manually flag violations of fields not handled by the form display. This // is necessary as entity form displays only flag violations for fields // contained in the display. $field_names = array(