return tag for methods returning array of objects

Published on

I always wondered how to write the @return tag for methods that return an array of objects. Today I discovered that you have to write:


class AnotherClass {

   * @return MyClass[]
  public function getClasses() {
    // logic here
    return $array_of_classes;

You can read the relevant docs here.