You can type hint this way using docblocks.
PHP editor (IDE) like PhpStorm supports this very well and will properly resolve the class when iterating over such array.
/**
* @return YourClass[]
*/
public function getObjects(): array
PHPStorm also supports nested arrays:
/**
* @return YourClass[][]
*/
public function getObjects(): array
Newer versions of PHPStorm support phpstan/psalm format:
/**
* @return array<int, YourObject>
*/
public function getObjects(): array
Or even generics:
/**
* @template T of object
* @param class-string<T> $className
* @return array<array-key, T>
*/
public function getCollectionOf(string $className): array