Поменял название

master v0.0.13
Rinsvent 3 years ago
parent 8030d3b3b2
commit 859a7c3e0f
  1. 2
      src/Attribute/TagsResolver.php
  2. 6
      src/Data2DtoConverter.php
  3. 4
      tests/unit/Converter/fixtures/FillTest/HelloTagsRequest.php

@ -3,7 +3,7 @@
namespace Rinsvent\Data2DTO\Attribute; namespace Rinsvent\Data2DTO\Attribute;
#[\Attribute] #[\Attribute]
class Tags class TagsResolver
{ {
public function __construct( public function __construct(
public string $method, public string $method,

@ -7,7 +7,7 @@ use Rinsvent\AttributeExtractor\ClassExtractor;
use Rinsvent\AttributeExtractor\PropertyExtractor; use Rinsvent\AttributeExtractor\PropertyExtractor;
use Rinsvent\Data2DTO\Attribute\DTOMeta; use Rinsvent\Data2DTO\Attribute\DTOMeta;
use Rinsvent\Data2DTO\Attribute\PropertyPath; use Rinsvent\Data2DTO\Attribute\PropertyPath;
use Rinsvent\Data2DTO\Attribute\Tags; use Rinsvent\Data2DTO\Attribute\TagsResolver;
use Rinsvent\Data2DTO\Attribute\VirtualProperty; use Rinsvent\Data2DTO\Attribute\VirtualProperty;
use Rinsvent\Data2DTO\Resolver\TransformerResolverStorage; use Rinsvent\Data2DTO\Resolver\TransformerResolverStorage;
use Rinsvent\Data2DTO\Transformer\Meta; use Rinsvent\Data2DTO\Transformer\Meta;
@ -189,8 +189,8 @@ class Data2DtoConverter
protected function processTags(object $object, array $data, array $tags): array protected function processTags(object $object, array $data, array $tags): array
{ {
$classExtractor = new ClassExtractor($object::class); $classExtractor = new ClassExtractor($object::class);
/** @var Tags $tagsMeta */ /** @var TagsResolver $tagsMeta */
if ($tagsMeta = $classExtractor->fetch(Tags::class)) { if ($tagsMeta = $classExtractor->fetch(TagsResolver::class)) {
if (method_exists($object, $tagsMeta->method)) { if (method_exists($object, $tagsMeta->method)) {
$reflectionMethod = new \ReflectionMethod($object, $tagsMeta->method); $reflectionMethod = new \ReflectionMethod($object, $tagsMeta->method);
if (!$reflectionMethod->isPublic()) { if (!$reflectionMethod->isPublic()) {

@ -3,9 +3,9 @@
namespace Rinsvent\Data2DTO\Tests\unit\Converter\fixtures\FillTest; namespace Rinsvent\Data2DTO\Tests\unit\Converter\fixtures\FillTest;
use Rinsvent\Data2DTO\Attribute\PropertyPath; use Rinsvent\Data2DTO\Attribute\PropertyPath;
use Rinsvent\Data2DTO\Attribute\Tags; use Rinsvent\Data2DTO\Attribute\TagsResolver;
#[Tags(method: 'getTags')] #[TagsResolver(method: 'getTags')]
class HelloTagsRequest extends HelloRequest class HelloTagsRequest extends HelloRequest
{ {
#[PropertyPath('fake_age2', tags: ['surname-group'])] #[PropertyPath('fake_age2', tags: ['surname-group'])]

Loading…
Cancel
Save