Skip to content

(fix) Add Correct targeting on attributes that work with property promotion #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/PropertyCasters/CastToArrayWithKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use EventSauce\ObjectHydrator\PropertySerializer;
use function is_object;

#[Attribute(Attribute::TARGET_PARAMETER | Attribute::IS_REPEATABLE)]
#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class CastToArrayWithKey implements PropertyCaster, PropertySerializer
{
public function __construct(private string $key)
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyCasters/CastToDateTimeImmutable.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use function assert;
use function is_int;

#[Attribute(Attribute::TARGET_PARAMETER | Attribute::IS_REPEATABLE)]
#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class CastToDateTimeImmutable implements PropertyCaster, PropertySerializer
{
public function __construct(private ?string $format = null, private ?string $timeZone = null)
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyCasters/CastToType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use EventSauce\ObjectHydrator\PropertySerializer;
use function settype;

#[Attribute(Attribute::TARGET_PARAMETER | Attribute::IS_REPEATABLE)]
#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class CastToType implements PropertyCaster, PropertySerializer
{
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion src/PropertyCasters/CastToUuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Ramsey\Uuid\UuidInterface;
use function assert;

#[Attribute(Attribute::TARGET_PARAMETER | Attribute::IS_REPEATABLE)]
#[Attribute(Attribute::TARGET_PARAMETER | Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
final class CastToUuid implements PropertyCaster, PropertySerializer
{
public function __construct(private string $type = 'string')
Expand Down