PHPDoc
Guilty Of PHP articles about PHPDoc
2 articles
-
Specify Required and Optional Array Keys with PHPDoc Shapes
Use `array{id: int, name: string, nickname?: string}` to give PHPStan or Psalm known keys and value types to analyze.
-
Annotate an Array of Task Objects with PHPDoc
Use `Task[]` or `array<Task>` to describe the values PHPStan should expect, and reserve `list<Task>` for arrays whose keys must also start at zero and stay sequential.
