Validate button type in Button class, closes #159 by rvanbaalen · Pull Request #160 · validformbuilder/validformbuilder · GitHub
Skip to content

Validate button type in Button class, closes #159#160

Open
rvanbaalen wants to merge 1 commit into
validformbuilder:masterfrom
rvanbaalen:feat/disallow-custom-button-types
Open

Validate button type in Button class, closes #159#160
rvanbaalen wants to merge 1 commit into
validformbuilder:masterfrom
rvanbaalen:feat/disallow-custom-button-types

Conversation

@rvanbaalen

@rvanbaalen rvanbaalen commented Feb 27, 2025

Copy link
Copy Markdown
Member

Description

This pull request introduces validation for the button type in the Button class. It ensures the type is one of the allowed values: 'submit', 'button', or 'reset'. An InvalidArgumentException will be thrown for invalid types, preventing potential misconfigurations.

This closes #159

Checklist

  • Tests for the added functionality have been included
  • Documentation has been updated if necessary

Add a check to ensure the button type is one of the allowed values: 'submit', 'button', or 'reset'. Throw an InvalidArgumentException for invalid types, preventing potential misconfigurations.

@flangfeldt flangfeldt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test for this new validation?

@rvanbaalen

Copy link
Copy Markdown
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only allow officially supported button types

2 participants