Skip to content

PHP DocBlock for Fields::new() needs updating #2264

@Toutouwai

Description

@Toutouwai

The DocBlock for Fields::new() is:

* @method Field new($type, $name, $label = '') Create and save a new Field of the given type (3.0.258+)

But the actual ___new() method has a default value for the $name parameter, and the third parameter is now the $options array, so the DocBlock should be updated to:

 * @method Field new($type, $name = '', $options = []) Create and save a new Field of the given type (3.0.258+)

Otherwise IDEs give warning highlighting for a missing required parameter when using an array for the first argument and therefore omitting the $name and $option arguments.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions