for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php declare(strict_types = 1);
namespace App\Entities;
class Posts implements \IteratorAggregate {
/** @var array<\App\Entities\Post> */
private array $posts;
public function __construct( Post ...$posts ) {
$this->posts = $posts;
}
/**
* {@inheritDoc}
*/
public function getIterator() {
return new \ArrayIterator( $this->posts );