Skip to content

Feature request: Checking type hint of fields against Doctrine metadata #31

Closed
@arnaud-lb

Description

@arnaud-lb

phpstan-doctrine could check if a field's typehint matches Doctrine's metadata.

In the following example, the plugin could emit a warning telling that int does not match string:

/**
 * @var int
 *
 * @Column(type="string")
 */
 private $var;

In the following examples, the plugin could emit a warning telling that the field is nullable:

/**
 * @var int // Should be nullable
 *
 * @Column(type="integer", nullable=true)
 */
 private $var;

/**
 * @var Foo // Should be nullable
 *
 * @OneToOne(targetEntity="Foo")

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