Use strict argument validation for collections

This resolves #106
This commit is contained in:
Ben Ramsey
2020-02-23 00:50:00 -06:00
parent a8f1692b7f
commit aaccc850a1
13 changed files with 111 additions and 87 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php
/**
* This file is part of the ramsey/uuid library
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
* @license http://opensource.org/licenses/MIT MIT
*/
declare(strict_types=1);
namespace Ramsey\Uuid\Builder;
use Ramsey\Collection\AbstractCollection;
use Ramsey\Collection\CollectionInterface;
use Traversable;
/**
* A collection of UuidBuilderInterface objects
*/
class BuilderCollection extends AbstractCollection implements CollectionInterface
{
public function getType(): string
{
return UuidBuilderInterface::class;
}
/**
* @psalm-mutation-free
* @psalm-suppress ImpureMethodCall
* @psalm-suppress InvalidTemplateParam
*/
public function getIterator(): Traversable
{
return parent::getIterator();
}
}