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

This commit is contained in:
Rinsvent 2021-08-18 22:51:37 +07:00
parent 8030d3b3b2
commit 859a7c3e0f
3 changed files with 6 additions and 6 deletions

View File

@ -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,

View File

@ -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()) {

View File

@ -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'])]