Allow iterable<T> where ramsey/collection would be used, deprecate collection classes

This patch is based on https://github.com/ramsey/uuid/pull/405

As discussed in https://github.com/ramsey/uuid/pull/405#discussion_r832095457, the `ramsey/collection`
dependency can be phased out.

Doing so via direct removal is not feasible without a clear BC break, so this change only deprecates:

 * `Ramsey\Uuid\Builder\BuilderCollection`
 * `Ramsey\Uuid\Provider\Node\NodeProviderCollection`

These classes will then be removed in `5.0.0`, along with the `ramsey/collection` dependency.
This commit is contained in:
Marco Pivetta
2022-03-22 17:30:42 +01:00
parent 53d9f35c65
commit f0ada112c5
7 changed files with 39 additions and 53 deletions
+3 -3
View File
@@ -25,14 +25,14 @@ use Ramsey\Uuid\Type\Hexadecimal;
class FallbackNodeProvider implements NodeProviderInterface
{
/**
* @var NodeProviderCollection
* @var iterable<NodeProviderInterface>
*/
private $nodeProviders;
/**
* @param NodeProviderCollection $providers Array of node providers
* @param iterable<NodeProviderInterface> $providers Array of node providers
*/
public function __construct(NodeProviderCollection $providers)
public function __construct(iterable $providers)
{
$this->nodeProviders = $providers;
}