mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-16 16:17:43 +03:00
chore: clean up types and PHP 8-ify the code
This commit is contained in:
@@ -24,24 +24,18 @@ use Ramsey\Uuid\Type\Hexadecimal;
|
||||
*/
|
||||
class FallbackNodeProvider implements NodeProviderInterface
|
||||
{
|
||||
/**
|
||||
* @var iterable<NodeProviderInterface>
|
||||
*/
|
||||
private $nodeProviders;
|
||||
|
||||
/**
|
||||
* @param iterable<NodeProviderInterface> $providers Array of node providers
|
||||
*/
|
||||
public function __construct(iterable $providers)
|
||||
public function __construct(private iterable $providers)
|
||||
{
|
||||
$this->nodeProviders = $providers;
|
||||
}
|
||||
|
||||
public function getNode(): Hexadecimal
|
||||
{
|
||||
$lastProviderException = null;
|
||||
|
||||
foreach ($this->nodeProviders as $provider) {
|
||||
foreach ($this->providers as $provider) {
|
||||
try {
|
||||
return $provider->getNode();
|
||||
} catch (NodeException $exception) {
|
||||
|
||||
Reference in New Issue
Block a user