From a448d592d2e5e73c5062271e77223e6464ac1e32 Mon Sep 17 00:00:00 2001 From: Meritoo Date: Mon, 2 Jul 2018 21:22:29 +0200 Subject: [PATCH] Documentation > Value Objects --- CHANGELOG.md | 4 +++ README.md | 1 + VERSION | 2 +- docs/Base-test-case.md | 1 + docs/Collection-of-elements.md | 1 + docs/Exceptions.md | 1 + docs/Static-methods.md | 1 + docs/Value-Objects.md | 53 ++++++++++++++++++++++++++++++++++ 8 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 docs/Value-Objects.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 03351e6..a8a5af2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Common and useful classes, methods, exceptions etc. +# 0.1.2 + +1. Documentation > Value Objects + # 0.1.1 1. TravisCI > run using PHP 7.2 too diff --git a/README.md b/README.md index 7b2e20e..94a0f44 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ composer require meritoo/common-library 2. [Collection of elements](docs/Collection-of-elements.md) 3. [Exceptions](docs/Static-methods.md) 4. [Static methods](docs/Static-methods.md) +5. [Value Objects](docs/Value-Objects.md) # Development diff --git a/VERSION b/VERSION index 17e51c3..d917d3e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.1 +0.1.2 diff --git a/docs/Base-test-case.md b/docs/Base-test-case.md index f8b7b1a..b0a038b 100644 --- a/docs/Base-test-case.md +++ b/docs/Base-test-case.md @@ -48,5 +48,6 @@ class MimeTypesTest extends BaseTestCase 2. [Collection of elements](Collection-of-elements.md) 3. [Exceptions](Exceptions.md) 4. [Static methods](Static-methods.md) +5. [Value Objects](Value-Objects.md) [‹ Back to `Readme`](../README.md) diff --git a/docs/Collection-of-elements.md b/docs/Collection-of-elements.md index fb0a600..67fde9f 100644 --- a/docs/Collection-of-elements.md +++ b/docs/Collection-of-elements.md @@ -46,5 +46,6 @@ var_dump($simpleCollection->has('dolor')); // bool(true) 2. [**Collection of elements**](Collection-of-elements.md) 3. [Exceptions](Exceptions.md) 4. [Static methods](Static-methods.md) +5. [Value Objects](Value-Objects.md) [‹ Back to `Readme`](../README.md) diff --git a/docs/Exceptions.md b/docs/Exceptions.md index eda4362..87b12c1 100644 --- a/docs/Exceptions.md +++ b/docs/Exceptions.md @@ -57,5 +57,6 @@ class UnknownSimpleTypeException extends UnknownTypeException 2. [Collection of elements](Collection-of-elements.md) 3. [**Exceptions**](Exceptions.md) 4. [Static methods](Static-methods.md) +5. [Value Objects](Value-Objects.md) [‹ Back to `Readme`](../README.md) diff --git a/docs/Static-methods.md b/docs/Static-methods.md index 87cd6fe..e503fe9 100644 --- a/docs/Static-methods.md +++ b/docs/Static-methods.md @@ -19,5 +19,6 @@ var_dump($firstElement); // string(5) "lorem" 2. [Collection of elements](Collection-of-elements.md) 3. [Exceptions](Exceptions.md) 4. [**Static methods**](Static-methods.md) +5. [Value Objects](Value-Objects.md) [‹ Back to `Readme`](../README.md) diff --git a/docs/Value-Objects.md b/docs/Value-Objects.md new file mode 100644 index 0000000..d26a0ae --- /dev/null +++ b/docs/Value-Objects.md @@ -0,0 +1,53 @@ +# Meritoo Common Library + +Common and useful classes, methods, exceptions etc. + +# Value Objects + +Located in `Meritoo\Common\ValueObject` namespace. + +### Version + +##### Namespace + +`Meritoo\Common\ValueObject\Version` + +##### Info + +Represents version of software. Contains 3 properties: +1. `$majorPart` - the "major" part of version +2. `$minorPart` - the "minor" part of version +3. `$patchPart` - the "patch" part of version + +##### New instance + +New instance can be created using: + +1. Constructor: + + ```php + new Version(1, 0, 2); + ``` + +2. Static methods: + 1. `fromArray()` - creates new instance using given version as array + + ```php + Version::fromArray([1, 0, 2]); + ``` + + 2. `fromString()` - creates new instance using given version as string: + + ```php + Version::fromString('1.0.2'); + ``` + +# More + +1. [Base test case (with common methods and data providers)](Base-test-case.md) +2. [Collection of elements](Collection-of-elements.md) +3. [Exceptions](Exceptions.md) +4. [Static methods](Static-methods.md) +5. [**Value Objects**](Value-Objects.md) + +[‹ Back to `Readme`](../README.md)