for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace GFG\Mapper\Data;
/**
* Creates a given type of mapper
*/
class MapperFactory
{
* @param Manager $manager
* @param string $type
* @param MapperInterface $mapper
* @param array $options
public function create(
Manager $manager,
$type,
MapperInterface $mapper,
array $options
) {
$name = str_replace(' ', '\\', ucwords(str_replace('-', ' ', $type)));
$class = __NAMESPACE__ . "\\Type\\$name";
return new $class($manager, $mapper, $options);
}