Skip to content

How to add explicit mixed type? #7033

Answered by samsonasik
brandonkelly asked this question in Q&A
Discussion options

You must be logged in to vote

@brandonkelly I stand corrected, it actually supported on AddPropertyTypeDeclarationRector, you can define explicit mixed type new MixedType(true) like the following:

return static function (ContainerConfigurator $containerConfigurator): void {
    $services = $containerConfigurator->services();

    $services->set(AddPropertyTypeDeclarationRector::class)
        ->configure([
            new AddPropertyTypeDeclaration('my\Class', 'value', new MixedType(true)),
        ]);
};

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brandonkelly
Comment options

Answer selected by samsonasik
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants