-
-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MultipleErrors->reason always returns [0] and should return first ite…
…m from associative array (#305) * Patch MultipleErrors->reason method by getting always the first item - Added Tests and a custom Exception * Return EmptyReason instead of throwing exception when MultipleErrors has no reasons (validations accomplished) Co-authored-by: Samuel Vicent <[email protected]>
- Loading branch information
Showing
3 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace Egulias\EmailValidator\Result\Reason; | ||
|
||
class EmptyReason implements Reason | ||
{ | ||
public function code() : int | ||
{ | ||
return 0; | ||
} | ||
|
||
public function description() : string | ||
{ | ||
return 'Empty reason'; | ||
} | ||
} |
This file contains 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