Skip to content
This repository was archived by the owner on Sep 17, 2019. It is now read-only.
This repository was archived by the owner on Sep 17, 2019. It is now read-only.

Better type hinting #5

@stancl

Description

@stancl
  1. arrays of X
public function addProducts(Product[] $products);
public function getProducts(): Product[];
  1. | in typehints
public function addProducts(Product[]|string[] $products):
  1. arrays with X keys and Y values
public function getProducts(): array<string, Product> // Product values, string keys
  1. It would be nice to be able to say "Collection of Products" (so a Collection with the first constructor argument being of type Product[]), but I have no idea how that should be notated.

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