Repository navigation
STF-1906: Add phone verification inputs #294
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e53fb4c
dc0bd39
44e59b8
0e0c95e
51af909
d277a21
c834432
791430d
262418d
48b5d20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -107,14 +107,21 @@ The library validates input by default (can be disabled with `validateInput: fal | |
| ```php | ||
| private function verifyCountryCode(string $country): void | ||
| { | ||
| if (!preg_match('/^[A-Z]{2}$/', $country)) { | ||
| if (!preg_match('/\A[A-Z]{2}\z/', $country)) { | ||
| $this->maybeThrowInvalidInputException("..."); | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| - Validation methods throw `InvalidInputException` when enabled | ||
| - `maybeThrowInvalidInputException()` respects the `validateInput` option | ||
| - Use the `\A` and `\z` anchors in a regex. `$` and `\Z` also match before a | ||
| trailing newline | ||
| - `remove()` always rejects a value with the wrong type, so checks after it | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Low: the example in this section still uses the The real target is line 110: 馃 Comment by Claude Opus 5.5.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 791430d. Reply by Claude Opus 5.5 on Greg's behalf. |
||
| can rely on the type without a `validateInput` guard | ||
| - Use `removeString()` for a free-form string field with no other check, or | ||
| for a field that already accepted an integer, such as `session_id`. It also | ||
| accepts an integer and converts it to a string | ||
| - Common validations: country codes, region codes, phone codes, email addresses, IP addresses | ||
|
|
||
| #### 6. **Dual Array/Named Arguments Pattern** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Low: the CHANGELOG does not say that
removeString()now accepts integers.On
mainwith validation on,withAccount(['user_id' => 123]),withBilling(['postal' => 6510]), andreport([..., 'transaction_id' => 123])throwInvalidInputException. With this PR they send"123"and"6510". This applies to about 25 free-form string fields. It is a user-facing change, and the repoCLAUDE.mdsays to updateCHANGELOG.mdfor user-facing changes. Only the commit message records it now.馃 Comment by Claude Opus 5.5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems okay to leave it out