Skip to content

Commit

Permalink
feature #54788 [TypeInfo] mark classes as experimental (soyuka)
Browse files Browse the repository at this point in the history
This PR was merged into the 7.1 branch.

Discussion
----------

[TypeInfo] mark classes as experimental

| Q             | A
| ------------- | ---
| Branch?       | 7.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| License       | MIT

This is following a discussion on slack with authors of the component, I feel that the TypeInfo component should have an experimental phase as we need to prove the component's functionality on software that is built on top of type information extraction. Here's a non-exhaustive list of software using the PropertyInfo Type class (thanks to `@mtarld`):

- api-platform/core
- nelmio/api-doc-bundle
- typo3/cms-extbase
- typo3/cms
- sonata-project/page-bundle
- jolicode/automapper
- symfony/ux-live-component

These softwares should try their best in testing the new TypeInfo component and report back misfunctionalities and/or DX improvements before we can consider this non-experimental. See also #54789

Commits
-------

28b6495 [TypeInfo] mark classes as experimental
  • Loading branch information
fabpot committed May 2, 2024
2 parents 29b00c2 + 28b6495 commit 09e3c5c
Show file tree
Hide file tree
Showing 23 changed files with 48 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/TypeInfo/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ CHANGELOG
7.1
---

* Add the component
* Add the component as experimental
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/**
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
interface ExceptionInterface extends \Throwable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/**
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Exception/LogicException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/**
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
class LogicException extends \LogicException implements ExceptionInterface
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/**
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
class RuntimeException extends \RuntimeException implements ExceptionInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
/**
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
class UnsupportedException extends \LogicException implements ExceptionInterface
{
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Component/TypeInfo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ TypeInfo Component

The TypeInfo component extracts PHP types information.

**This Component is experimental**.
[Experimental features](https://symfony.com/doc/current/contributing/code/experimental.html)
are not covered by Symfony's
[Backward Compatibility Promise](https://symfony.com/doc/current/contributing/code/bc.html).

Getting Started
---------------

Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
/**
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
abstract class Type implements \Stringable
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/BackedEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* @template U of BuiltinType<TypeIdentifier::INT>|BuiltinType<TypeIdentifier::STRING>
*
* @extends EnumType<T>
*
* @experimental
*/
final class BackedEnumType extends EnumType
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/BuiltinType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @template T of TypeIdentifier
*
* @experimental
*/
final class BuiltinType extends Type
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/CollectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @template T of BuiltinType<TypeIdentifier::ARRAY>|BuiltinType<TypeIdentifier::ITERABLE>|ObjectType|GenericType
*
* @experimental
*/
final class CollectionType extends Type
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/EnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
* @template T of class-string<\UnitEnum>
*
* @extends ObjectType<T>
*
* @experimental
*/
class EnumType extends ObjectType
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/GenericType.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @template T of BuiltinType<TypeIdentifier::ARRAY>|BuiltinType<TypeIdentifier::ITERABLE>|ObjectType
*
* @experimental
*/
final class GenericType extends Type
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/IntersectionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @template T of Type
*
* @experimental
*/
final class IntersectionType extends Type
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @template T of class-string
*
* @experimental
*/
class ObjectType extends Type
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/TemplateType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
final class TemplateType extends Type
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/Type/UnionType.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @template T of Type
*
* @experimental
*/
final class UnionType extends Type
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/TypeContext/TypeContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
final class TypeContext
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
final class TypeContextFactory
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/TypeFactoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
trait TypeFactoryTrait
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/TypeIdentifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
enum TypeIdentifier: string
{
Expand Down
2 changes: 2 additions & 0 deletions src/Symfony/Component/TypeInfo/TypeResolver/TypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
final readonly class TypeResolver implements TypeResolverInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
*
* @author Mathias Arlaud <mathias.arlaud@gmail.com>
* @author Baptiste Leduc <baptiste.leduc@gmail.com>
*
* @experimental
*/
interface TypeResolverInterface
{
Expand Down

0 comments on commit 09e3c5c

Please sign in to comment.