Skip to content

Commit

Permalink
README update
Browse files Browse the repository at this point in the history
  • Loading branch information
xificurk committed Oct 29, 2018
1 parent f047be0 commit 4881cd1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ Usage

#### Creating value object
```php
$emailAddress = new Nepada\EmailAddress\EmailAddress('Real.example+suffix@HÁČKYčárky.cz');
$emailAddress = Nepada\EmailAddress\EmailAddress::fromString('Real.example+suffix@HÁČKYčárky.cz');
$emailAddress = Nepada\EmailAddress\EmailAddress::fromDomainAndLocalPart('HÁČKYčárky.cz', 'Real.example+suffix');
```
`Nepada\EmailAddress\InvalidEmailAddressException` is thrown in case of invalid input value.

#### Converting back to string
```php
echo((string) $emailAddress); // Real.example+suffix@HÁČKYčárky.cz
echo($emailAddress->toString()); // Real.example+suffix@HÁČKYčárky.cz
echo($emailAddress->getOriginalValue()); // Real.example+suffix@HÁČKYčárky.cz
```

Expand Down

0 comments on commit 4881cd1

Please sign in to comment.