for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
/**
* /src/AutoMapper/RestAutoMapperConfiguration.php
*
* @author TLe, Tarmo Leppänen <[email protected]>
*/
namespace App\AutoMapper;
use AutoMapperPlus\AutoMapperPlusBundle\AutoMapperConfiguratorInterface;
use AutoMapperPlus\Configuration\AutoMapperConfigInterface;
use AutoMapperPlus\MapperInterface;
use Symfony\Component\HttpFoundation\Request;
* Class RestAutoMapperConfiguration
* @package App\AutoMapper
abstract class RestAutoMapperConfiguration implements AutoMapperConfiguratorInterface
{
* Classes to use specified request mapper.
* @var array<int, class-string>
array<int, class-string>
4
protected static array $requestMapperClasses = [];
public function __construct(
protected readonly MapperInterface $requestMapper,
) {
}
* Use this method to register your mappings.
* @psalm-suppress UndefinedThisPropertyFetch
public function configure(AutoMapperConfigInterface $config): void
foreach (static::$requestMapperClasses as $requestMapperClass) {
$config
->registerMapping(Request::class, $requestMapperClass)
->useCustomMapper($this->requestMapper);