You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* use spread syntax instead of array_merge()
* use type cast instead of function cast
* removed redundant returns
* removed redundant phpdoc - type is already inferred
* removed invalid phpdoc - type is already inferred
The PHPDoc return type hint was incomplete, it should have been `InvalidEmail|null`, however, it can be removed altogether as the return type is already inferred from the code.
* changed warnEscaping()'s return value from bool to void
This is not a breaking change as the method is private, and it's only used at one place, where the return value was not used anyway.
* made private class property local
`private $parser` was used in only one place, hence it can be local, there is no reason to put it into the class' scope.
* removed unnecessary type casting
Concatenation already casts `static::CODE` from `int` to `string`, no reason to do it explicitly.
* removed redundant initializers - constructor overwrites them immediately
* removed redundant else block
* simplified if-else statement
* wrapped if body in brackets to comply with PSR12
* fixed README formatting
- fixed numbering at the `Available validations` section
- fixed overall formatting
* Revert "removed redundant phpdoc - type is already inferred"
This reverts commit 68a9ae2.
* don't wrap long lines
* make properties typed
Also using constructor property promotion, see more info about it [here](https://php.watch/versions/8.0/constructor-property-promotion).
*[Composer](https://getcomposer.org) is required for installation
36
36
*[Spoofchecking](/src/Validation/Extra/SpoofCheckValidation.php) and [DNSCheckValidation](/src/Validation/DNSCheckValidation.php) validation requires that your PHP system has the [PHP Internationalization Libraries](https://php.net/manual/en/book.intl.php) (also known as PHP Intl)
37
37
38
38
**Note**: `PHP version upgrades will happen to accomodate to the pace of major frameworks. Minor versions bumps will go via minor versions of this library (i.e: PHP7.3 -> v3.x+1). Major versions will go with major versions of the library`
39
39
40
-
## Installation ##
40
+
## Installation
41
41
42
42
Run the command below to install via Composer
43
43
44
44
```shell
45
45
composer require egulias/email-validator
46
46
```
47
47
48
-
## Getting Started ##
48
+
## Getting Started
49
49
50
50
`EmailValidator` requires you to decide which (or combination of them) validation/s strategy/ies you'd like to follow for each [validation](#available-validations).
51
51
@@ -61,14 +61,14 @@ $validator->isValid("example@example.com", new RFCValidation()); //true
61
61
```
62
62
63
63
64
-
### Available validations ###
64
+
### Available validations
65
65
66
66
1.[RFCValidation](/src/Validation/RFCValidation.php): Standard RFC-like email validation.
67
67
2.[NoRFCWarningsValidation](/src/Validation/NoRFCWarningsValidation.php): RFC-like validation that will fail when warnings* are found.
68
68
3.[DNSCheckValidation](/src/Validation/DNSCheckValidation.php): Will check if there are DNS records that signal that the server accepts emails. This does not entail that the email exists.
69
-
5.[MultipleValidationWithAnd](/src/Validation/MultipleValidationWithAnd.php): It is a validation that operates over other validations performing a logical and (&&) over the result of each validation.
70
-
6.[MessageIDValidation](/src/Validation/MessageIDValidation.php): Follows [RFC2822 for message-id](https://tools.ietf.org/html/rfc2822#section-3.6.4) to validate that field, that has some differences in the domain part.
71
-
7.[Your own validation](#how-to-extend): You can extend the library behaviour by implementing your own validations.
69
+
4.[MultipleValidationWithAnd](/src/Validation/MultipleValidationWithAnd.php): It is a validation that operates over other validations performing a logical and (&&) over the result of each validation.
70
+
5.[MessageIDValidation](/src/Validation/MessageIDValidation.php): Follows [RFC2822 for message-id](https://tools.ietf.org/html/rfc2822#section-3.6.4) to validate that field, that has some differences in the domain part.
71
+
6.[Your own validation](#how-to-extend): You can extend the library behaviour by implementing your own validations.
72
72
73
73
*warnings: Warnings are deviations from the RFC that in a broader interpretation are accepted.
74
74
@@ -89,21 +89,21 @@ $multipleValidations = new MultipleValidationWithAnd([
0 commit comments