Skip to content

Commit

Permalink
rename to PropertyMappingMetadata
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Oct 14, 2024
1 parent 4007423 commit 8ba43b6
Show file tree
Hide file tree
Showing 9 changed files with 314 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use Rekalogika\Mapper\Transformer\MetadataUtil\TargetClassResolverInterface;
use Rekalogika\Mapper\Transformer\ObjectToObjectMetadata\ObjectToObjectMetadata;
use Rekalogika\Mapper\Transformer\ObjectToObjectMetadata\ObjectToObjectMetadataFactoryInterface;
use Rekalogika\Mapper\Transformer\ObjectToObjectMetadata\PropertyMapping;
use Rekalogika\Mapper\Transformer\ObjectToObjectMetadata\PropertyMappingMetadata;
use Rekalogika\Mapper\Transformer\ObjectToObjectMetadata\ReadMode;
use Rekalogika\Mapper\Util\ClassUtil;

Expand Down Expand Up @@ -126,7 +126,7 @@ class: $targetClass,

// instantiate property mapping

$propertyMapping = new PropertyMapping(
$propertyMapping = new PropertyMappingMetadata(
id: $id,
sourceProperty: $sourcePropertyMetadata->getReadMode() !== ReadMode::None ? $sourceProperty : null,
targetProperty: $targetProperty,
Expand Down Expand Up @@ -217,7 +217,7 @@ class: $targetClass,
/**
* @param class-string $targetClass
* @param list<string> $eagerProperties
* @param array<string,PropertyMapping> $constructorPropertyMappings
* @param array<string,PropertyMappingMetadata> $constructorPropertyMappings
* @return array{array<string,true>,bool}
*/
private function getProxyParameters(
Expand Down
22 changes: 11 additions & 11 deletions src/Transformer/ObjectToObjectMetadata/ObjectToObjectMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@
final readonly class ObjectToObjectMetadata
{
/**
* @var array<string,PropertyMapping>
* @var array<string,PropertyMappingMetadata>
*/
private array $allPropertyMappings;

/**
* @var array<string,PropertyMapping>
* @var array<string,PropertyMappingMetadata>
*/
private array $propertyMappings;

/**
* @var array<string,PropertyMapping>
* @var array<string,PropertyMappingMetadata>
*/
private array $constructorPropertyMappings;

/**
* @var array<string,PropertyMapping>
* @var array<string,PropertyMappingMetadata>
*/
private array $lazyPropertyMappings;

/**
* @var array<string,PropertyMapping>
* @var array<string,PropertyMappingMetadata>
*/
private array $eagerPropertyMappings;

Expand All @@ -53,7 +53,7 @@
* @param class-string $targetClass Effective target class after resolving inheritance map
* @param class-string $providedTargetClass
* @param list<class-string> $allTargetClasses
* @param list<PropertyMapping> $allPropertyMappings
* @param list<PropertyMappingMetadata> $allPropertyMappings
* @param array<string,true> $targetProxySkippedProperties
* @param list<string> $sourceProperties List of the source properties. Used by `ObjectToObjectTransformer` to determine if a property is a dynamic property. A property not listed here is considered dynamic.
*/
Expand Down Expand Up @@ -219,39 +219,39 @@ public function isTargetUnalterable(): bool
}

/**
* @return array<string,PropertyMapping>
* @return array<string,PropertyMappingMetadata>
*/
public function getPropertyMappings(): array
{
return $this->propertyMappings;
}

/**
* @return array<string,PropertyMapping>
* @return array<string,PropertyMappingMetadata>
*/
public function getLazyPropertyMappings(): array
{
return $this->lazyPropertyMappings;
}

/**
* @return array<string,PropertyMapping>
* @return array<string,PropertyMappingMetadata>
*/
public function getEagerPropertyMappings(): array
{
return $this->eagerPropertyMappings;
}

/**
* @return array<string,PropertyMapping>
* @return array<string,PropertyMappingMetadata>
*/
public function getConstructorPropertyMappings(): array
{
return $this->constructorPropertyMappings;
}

/**
* @return array<string,PropertyMapping>
* @return array<string,PropertyMappingMetadata>
*/
public function getAllPropertyMappings(): array
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @immutable
* @internal
*/
final readonly class PropertyMapping
final readonly class PropertyMappingMetadata
{
/**
* @var array<int,Type> $sourceTypes
Expand Down
Loading

0 comments on commit 8ba43b6

Please sign in to comment.