diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/docs/homepage.md b/docs/homepage.md new file mode 100644 index 00000000..9520417c --- /dev/null +++ b/docs/homepage.md @@ -0,0 +1,48 @@ +# Welcome 👋 + +Welcome to the AutoMapper documentation, this library solves a simple problem: removing all the code you need to +map one object to another. A boring code to write and often replaced by less-performant alternatives like the Symfony's +Serializer. + +AutoMapper uses a convention-based matching algorithm to match up source to destination values. AutoMapper is geared +towards model projection scenarios to flatten complex object models to DTOs and other simple objects, whose design is +better suited for serialization, communication, messaging, or simply an anti-corruption layer between the domain and +application layer. + +## Quick start 🚀 + +### What is the AutoMapper ? 🤔 + +The AutoMapper is an object-object mapper. Object-object mapping works by transforming an input object of one type into +an output object of a different type. What makes AutoMapper interesting is that it provides some interesting conventions +to take the dirty work out of figuring out how to map type A to type B and it has a strong aim on performance by +generating the mappers whenever you require it. As long as type B follows AutoMapper’s established convention, almost +zero configuration is needed to map two types. + +### Why should I use it ? 🙋 + +Mapping code is boring. And in PHP, you often replace that by using Symfony's Serializer because you don't want to do +it by hand. We were doing the same but performance made it not possible anymore. The AutoMapper replaces the Serializer +to do the same output by generating PHP code so it's like your wrote the mappers yourself. + +The real question may be “why use object-object mapping?” Mapping can occur in many places in an application, but +mostly in the boundaries between layers, such as between the UI/Domain layers, or Service/Domain layers. Concerns of +one layer often conflict with concerns in another, so object-object mapping leads to segregated models, where concerns +for each layer can affect only types in that layer. + +### Installation 📦 + +```shell +$ composer require jolicode/automapper +``` + +### How to use it ? 🕹️ + +First, you need both a source and destination type to work with. The destination type’s design can be influenced by the +layer in which it lives, but the AutoMapper works best as long as the names of the members match up to the source +type’s members. If you have a source member called "firstName", this will automatically be mapped to a destination +member with the name "firstName". + +The AutoMapper will accept any array of object as source type and any class-string, array or object as target type. + +TODO \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 00000000..4d19a2a1 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,31 @@ + + + + + Document + + + + + + +
+ + + + + + + diff --git a/docs/navigation.md b/docs/navigation.md new file mode 100644 index 00000000..c65a317d --- /dev/null +++ b/docs/navigation.md @@ -0,0 +1,2 @@ +- [Quick start](/) +- Coucou \ No newline at end of file