I have a mehtod that returns timestamps. I want to do something like this:
class MyAwesomeService {
/**
* @return array<int, timestamp>
*/
public function myAwesomeMethod(): array
{
return [
1636380000,
1636385555,
1636386666,
];
}
}
However, I don't think @return array<int, timestamp> is valid.
What is the valid format for specifying timestamps in docblocks?
You can use
int[], there is no valid value for timestamps. You can however create a ValueObject.If you use a value object: