Files
archived-collections/tests/DerivedArrayCollection.php
Grégoire Paris 5e458f65bd Flatten directory tree
This seems to have been forgotten in e1751ba799
2024-02-17 22:34:24 +01:00

31 lines
657 B
PHP

<?php
declare(strict_types=1);
namespace Doctrine\Tests\Common\Collections;
use Doctrine\Common\Collections\ArrayCollection;
use stdClass;
/**
* Simple collection implements different constructor semantics.
*/
final class DerivedArrayCollection extends ArrayCollection
{
/** @param mixed[] $elements */
public function __construct(private readonly stdClass $foo, array $elements = [])
{
parent::__construct($elements);
}
/**
* @param mixed[] $elements
*
* @return self<mixed>
*/
protected function createFrom(array $elements): static
{
return new static($this->foo, $elements);
}
}