Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC-26233 Added additional validation for address form #4

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Spryker/Zed/Customer/Communication/Form/AddressForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ protected function addFirstNameField(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_FIRST_NAME, TextType::class, [
'label' => 'First Name',
'sanitize_xss' => true,
'constraints' => $this->getTextFieldConstraints(),
]);

Expand All @@ -218,6 +219,7 @@ protected function addLastNameField(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_LAST_NAME, TextType::class, [
'label' => 'Last Name',
'sanitize_xss' => true,
'constraints' => $this->getTextFieldConstraints(),
]);

Expand All @@ -233,6 +235,7 @@ protected function addAddress1Field(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_ADDRESS_1, TextType::class, [
'label' => 'Address line 1',
'sanitize_xss' => true,
'constraints' => [
new NotBlank(),
new Length(['max' => 255]),
Expand All @@ -251,6 +254,7 @@ protected function addAddress2Field(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_ADDRESS_2, TextType::class, [
'label' => 'Address line 2',
'sanitize_xss' => true,
'constraints' => [
new Length(['max' => 255]),
],
Expand All @@ -268,6 +272,7 @@ protected function addAddress3Field(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_ADDRESS_3, TextType::class, [
'label' => 'Address line 3',
'sanitize_xss' => true,
'constraints' => [
new Length(['max' => 255]),
],
Expand All @@ -285,6 +290,7 @@ protected function addCityField(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_CITY, TextType::class, [
'label' => 'City',
'sanitize_xss' => true,
'constraints' => [
new NotBlank(),
new Length(['max' => 255]),
Expand All @@ -303,6 +309,7 @@ protected function addZipCodeField(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_ZIP_CODE, TextType::class, [
'label' => 'Zip Code',
'sanitize_xss' => true,
'constraints' => [
new NotBlank(),
new Length(['max' => 15]),
Expand Down Expand Up @@ -343,6 +350,7 @@ protected function addPhoneField(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_PHONE, TextType::class, [
'label' => 'Phone',
'sanitize_xss' => true,
'constraints' => [
new Length(['max' => 255]),
],
Expand All @@ -360,6 +368,7 @@ protected function addCompanyField(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_COMPANY, TextType::class, [
'label' => 'Company',
'sanitize_xss' => true,
'constraints' => [
new Length(['max' => 255]),
],
Expand All @@ -377,6 +386,7 @@ protected function addCommentField(FormBuilderInterface $builder)
{
$builder->add(static::FIELD_COMMENT, TextareaType::class, [
'label' => 'Comment',
'sanitize_xss' => true,
'constraints' => [
new Length(['max' => 255]),
],
Expand Down