Skip to content

simple array type hint for nullable not include null #435

Description

@PawelSuwinski

Such schema:

types:
  Project:
    properties:
      shareWith:
        range: "https://schema.org/email"
        cardinality: "(0..*)"
        attributes:
           ORM\Column: { type: "simple_array" }

Will generate:

    /**
     * @var array|null
     *
     * @see _:shareWith
     */
    #[ORM\Column(type: 'simple_array', nullable: true)]
    private array $shareWith = [];

    /**
     * @return array|null
     */
    public function getShareWith(): array
    {
        return $this->shareWith;
    }
// ... adder, remover or setter

And should be

/**
     * @see _:shareWith
     */
    #[ORM\Column(type: 'simple_array', nullable: true)]
    private ?array $shareWith = [];

    public function getShareWith(): ?array
    {
        return $this->shareWith;
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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