From 2247000a8a58086cfa9ba3899d28d11af9d7cdf5 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Mon, 4 Mar 2019 18:52:07 +0100 Subject: [PATCH] Documentation > Value Objects > add missing information --- docs/Value-Objects.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/Value-Objects.md b/docs/Value-Objects.md index 90b41e4..171947f 100644 --- a/docs/Value-Objects.md +++ b/docs/Value-Objects.md @@ -67,7 +67,7 @@ $asString = (string)$address; // "4th Avenue 10/200, 00123, New York" Represents bank account. Contains properties: 1. `$bankName` - name of bank -2. $accountNumber` - number of bank's account +2. `$accountNumber` - number of bank's account ##### New instance @@ -173,6 +173,17 @@ New instance can be created using: Version::fromString('1.0.2'); ``` +##### Conversion to string (the `__toString()` method) + +Instance of `Version` may be represented as string that contains all properties separated by `.` (`$majorPart`.`$minorPart`.`$patchPart`). + +Example: + +```php +$version = new Version(1, 0, 2); +$asString = (string)$version; // "1.0.2" +``` + # More 1. [Base test case (with common methods and data providers)](Base-test-case.md)