如何正确记录数组返回类型的键?

class Foo
{
    /**
    *   
    * @return array
    */
    public funtion bar(): array
    {
        return [
            'x' => 1,
            'y' => 2        
        ];
    }
}

How do you properly tell in the documentation that bar() returns an array with x and y as keys?

Actually this is not supported yet on PHP Doc (and I doubt that it will be in the future)...

Anyway you can write your array structure in the description part of @return:

/**
 * @return mixed[] Description, structured as:
 *                [
 *                   'x' => int
 *                   'y' => string
 *                ];
 */