Skip to content

Type constraint link to removed php function and is not used in symfony #17665

Closed
@alamirault

Description

@alamirault

On this page https://symfony.com/doc/current/reference/constraints/Type.html#type, we have a link to some php is_* functions.

* :phpfunction:`array <is_array>`
* :phpfunction:`bool <is_bool>`
* :phpfunction:`callable <is_callable>`
* :phpfunction:`float <is_float>`
* :phpfunction:`double <is_double>`
* :phpfunction:`int <is_int>`
* :phpfunction:`integer <is_integer>`
* :phpfunction:`iterable <is_iterable>`
* :phpfunction:`long <is_long>`
* :phpfunction:`null <is_null>`
* :phpfunction:`numeric <is_numeric>`
* :phpfunction:`object <is_object>`
* :phpfunction:`real <is_real>`
* :phpfunction:`resource <is_resource>`
* :phpfunction:`scalar <is_scalar>`
* :phpfunction:`string <is_string>`

is_real is deprecated since php 8.0.

And Type Validator does not use this function (same for is_double)

https://github.com/symfony/symfony/blob/ed96673e64ebaca3f47012c230823dcddd59a2ba/src/Symfony/Component/Validator/Constraints/TypeValidator.php#L24-L41

WDYT to update doc, and for each type, precise real php function used.

Maybe something like this ? (I don't know if it's a valid syntax for SymfonyDocsBuilder)

:phpfunction:`float, double, real <is_float>`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions