FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fixed TypeError thrown by string-based validation rules on non-string values by NoraClapham · Pull Request #7794 · hyperf/hyperf · GitHub

/ hyperf Public

Fixed TypeError thrown by string-based validation rules on non-string values - #7794

Open
NoraClapham wants to merge 1 commit into
hyperf:masterfrom
NoraClapham:patch-4
Open

Fixed TypeError thrown by string-based validation rules on non-string values#7794
NoraClapham wants to merge 1 commit into
hyperf:masterfrom
NoraClapham:patch-4

Conversation

Copy link
Copy Markdown
Contributor

Problem

Six rules pass the raw value into Str methods that declare a string
parameter. Since Str.php is under strict_types=1, a non-string value
raises a TypeError instead of failing validation.

$factory->make(['code' => 123], ['code' => 'string|uppercase'])->fails();

// TypeError: Hyperf\Stringable\Str::upper(): Argument #1 ($value)
// must be of type string, int given

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

1 participant


Back | FazBrowse Home | New Git URL