Skip to content
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

[TypeInfo] Add TypeFactoryTrait::fromValue method #20575

Closed
fabpot opened this issue Jan 17, 2025 · 2 comments · Fixed by #20781
Closed

[TypeInfo] Add TypeFactoryTrait::fromValue method #20575

fabpot opened this issue Jan 17, 2025 · 2 comments · Fixed by #20781
Labels
Milestone

Comments

@fabpot
Copy link
Member

fabpot commented Jan 17, 2025

Q A
Feature PR symfony/symfony#59368
PR author(s) @mtarld
Merged in 7.3

We created this issue to not forget to document this new feature. We would really appreciate if you can help us with this task. If you are not sure how to do it, please ask us and we will help you.

To fix this issue, please create a PR against the 7.3 branch in the symfony-docs repository.

Thank you! 😃

@fabpot fabpot added this to the 7.3 milestone Jan 17, 2025
@alamirault
Copy link
Contributor

alamirault commented Mar 18, 2025

Trait is only documented here

There are two ways to use this component. First one is to create a type manually thanks
to the :class:`Symfony\\Component\\TypeInfo\\Type` static methods as following::
use Symfony\Component\TypeInfo\Type;
Type::int();
Type::nullable(Type::string());
Type::generic(Type::object(Collection::class), Type::int());
Type::list(Type::bool());
Type::intersection(Type::object(\Stringable::class), Type::object(\Iterator::class));
// Many others are available and can be
// found in Symfony\Component\TypeInfo\TypeFactoryTrait

All methods are not listed.

@mtarld You think we must add one or multiple example for fromValue method ? Or not

(I can make PR)

@mtarld
Copy link
Contributor

mtarld commented Mar 18, 2025

@alamirault, yes I think that we can provide one example of the fromValue 🙂

But I'm not sure that more than one example is useful here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants