Skip to content

Conversation

vivianequinaia
Copy link
Contributor

@vivianequinaia vivianequinaia commented Apr 30, 2021

Valida se todos os caracteres do Código Postal são caracteres numéricos

Copy link
Member

@gnumoksha gnumoksha left a comment

Choose a reason for hiding this comment

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

add test case

@@ -23,7 +23,7 @@ protected function setValue(string $value): void
$characters++;
}

if (empty($value) || $characters != 5 && $characters != 9) {
if (empty($value) || ctype_digit($changedValue) !== true || ($characters != 5 && $characters != 9)) {

Choose a reason for hiding this comment

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

Primeira vez na vida que vejo essa função 😆

@vivianequinaia vivianequinaia merged commit 666fcfb into master May 3, 2021
@vivianequinaia vivianequinaia deleted the bug/validate-postalcode branch May 3, 2021 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants