parent
f0683ef40d
commit
4083f1937e
@ -1,13 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace Rinsvent\RequestBundle\Service\Transformer; |
||||
|
||||
use Rinsvent\Data2DTO\Transformer\TransformerInterface; |
||||
|
||||
abstract class AbstractTransformer implements TransformerInterface |
||||
{ |
||||
public static function getLocatorKey() |
||||
{ |
||||
return static::class; |
||||
} |
||||
} |
@ -1,23 +0,0 @@ |
||||
<?php |
||||
|
||||
namespace Rinsvent\RequestBundle\Service\Transformer; |
||||
|
||||
use Rinsvent\Data2DTO\Resolver\TransformerResolverInterface; |
||||
use Rinsvent\Data2DTO\Transformer\Meta; |
||||
use Rinsvent\Data2DTO\Transformer\TransformerInterface; |
||||
use Symfony\Component\DependencyInjection\ServiceLocator; |
||||
|
||||
class ServiceResolver implements TransformerResolverInterface |
||||
{ |
||||
public const TYPE = 'service'; |
||||
|
||||
public function __construct( |
||||
private ServiceLocator $transformerLocator |
||||
) {} |
||||
|
||||
public function resolve(Meta $meta): TransformerInterface |
||||
{ |
||||
$transformerClass = $meta::class . 'Transformer'; |
||||
return $this->transformerLocator->get($transformerClass); |
||||
} |
||||
} |
Loading…
Reference in new issue