Skip to content

Commit

Permalink
Merge pull request #3 from HRADigital/improve-documentation
Browse files Browse the repository at this point in the history
Improve documentation
  • Loading branch information
HRADigital authored Mar 22, 2022
2 parents 32fc264 + 977671a commit bf0bafd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
[![Version](https://img.shields.io/github/release/HRADigital/php-datatypes.svg)](https://github.com/HRADigital/php-datatypes)
[![PHP](https://img.shields.io/packagist/php-v/hradigital/php-datatypes.svg)](https://github.com/HRADigital/php-datatypes)

## Code Usage

In order to learn more about the code, please go [here](https://github.com/HRADigital/php-datatypes/blob/master/src/ValueObjects).

## About

**PHP Datatypes** is meant to provide an easy way to create your Value Objects/Entities/Aggregates, in a fast and platform agnostic way,
Expand All @@ -21,27 +25,27 @@ that promotes:
- Full data serializing
- No 3rd party dependency apart from PHP. Clean/Self reliant project.

An Aggregate/Entity/ValueObject that extends [AbstractValueObject](/HRADigital/php-datatypes/blob/master/src/ValueObjects/AbstractValueObject.php)
will be built using predefined/tested [Traits](/HRADigital/php-datatypes/tree/master/src/Traits/Entities) for each of the class attributes,
An Aggregate/Entity/ValueObject that extends [AbstractValueObject](https://github.com/HRADigital/php-datatypes/blob/master/src/ValueObjects/AbstractValueObject.php)
will be built using predefined/tested [Traits](https://github.com/HRADigital/php-datatypes/tree/master/src/Traits/Entities) for each of the class attributes,
leaving your class definition cleaned/free for your business logic implementation.

This will also allow you to reuse/load your objects with data that can come from a Database, Webservice, Event payload, etc...

Getters/Accessors for class attributes will return ValueObjects instead of primitive types, as much as possible. All these datatypes will
also be included in the package, as it doesn't have any dependencies apart from, PHP itself.

To learn how to use this package, please go to [AbstractValueObject](/HRADigital/php-datatypes/blob/master/src/ValueObjects/) documentation.
To learn how to use this package, please go to [AbstractValueObject](https://github.com/HRADigital/php-datatypes/blob/master/src/ValueObjects/) documentation.

### Inspiration

Some of the projects that inspired this one, are mainly [Nikita Popov's Scalar Objects](/nikic/scalar_objects),
but also [Martin Helmich's Scalar Classes](/martin-helmich/php-scalarclasses/) and
[Michael Hall's Datatypes](/themichaelhall/datatypes/).
Some of the projects that inspired this one, are mainly [Nikita Popov's Scalar Objects](https://github.com/nikic/scalar_objects),
but also [Martin Helmich's Scalar Classes](https://github.com/martin-helmich/php-scalarclasses/) and
[Michael Hall's Datatypes](https://github.com/themichaelhall/datatypes/).

Due to the "_No 3rd party dependency_" rule, this package will use some simplified versions of more popular datatypes. Some examples are:

- [synfony/string](/symfony/string), for String related manipulations.
- [nesbot/carbon](/briannesbitt/Carbon), for DateTime manipulations.
- [synfony/string](https://github.com/symfony/string), for String related manipulations.
- [nesbot/carbon](https://github.com/briannesbitt/Carbon), for DateTime manipulations.
- ...

## Requirements & Installation
Expand Down
5 changes: 5 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ For more information about each type of available object, please read dedicated
- [Traits](Traits/)
- [ValueObjects](ValueObjects/)
- [Web](Web/)

## Getting started

If you want to get started with this package, please read
[Abstract Value Object's documentation](https://github.com/HRADigital/php-datatypes/blob/master/src/ValueObjects).

0 comments on commit bf0bafd

Please sign in to comment.