Download the PHP package bluepsyduck/mapper-manager without Composer

On this page you can find all versions of the php package bluepsyduck/mapper-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mapper-manager

Mapper Manager

GitHub release (latest SemVer) build Codecov

The Mapper Manager is, as the name already suggests, a manager of mappers between different types of objects.

Mapper

The mapper supports different types of mappers, which have the difference in how they evaluate whether they can map a certain pair of objects or not. Each type of mapper comes with an interface and a corresponding adapter for the manager to handle this type of mappers. New types can always be added in the client code if there is a need for them.

If a mapper requires access to the MapperManager to e.g. map other objects, you have to implement the MapperManagerAwareInterface to have it get injected into your mapper instance to avoid having circular dependencies. You may use the MapperManagerAwareTrait to implement this interface with a simple setter method.

Static Mapper

A static mapper implementing the StaticMapperInterface knows the combination of source and destination object it supports based only on the classes, without knowing the actual instances of the objects. The support is evaluated once when the mapper is added to the manager.

Note: The classes of source and destination must match exactly, the static mapper does not check for any inheritance. For example, if there is a class A and a class B extends A, and the mapper returns A as supported class, it won't match if an instance of B is passed instead. If inheritance must be supported, use a dynamic mapper instead.

It is recommended to always use static mappers if possible, as matching the mapper in the manager is faster with static mappers than with dynamic ones.

Example

Dynamic Mapper

A dynamic mapper implementing the DynamicMapperInterface will decide whether a combination of source and destination object is supported on the actual instances of the objects. This allows to add additional criteria for support based on the two involved objects. The support is re-evaluated for each source and destination object passed to the mapper manager.

Example

Usage

The usage of the mapper manager is rather straight forward: Create an instance of the MapperManager class, add some adapters, and afterwards add your actual mapper implementations.

Mezzio

When using Mezzio, you can add the ConfigProvider of the library to your application config and access the already-initialized mapper manager through the container using MapperManagerInterface::class or MapperManager::class as alias.

Add the following config to your project to customize the manager:

Then access the mapper manager through the container:


All versions of mapper-manager with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
psr/container Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bluepsyduck/mapper-manager contains the following files

Loading the files please wait ....