chore: clean up types and PHP 8-ify the code

This commit is contained in:
Ben Ramsey
2022-09-15 22:14:04 -05:00
parent ef842484ba
commit ae247f1dcd
39 changed files with 225 additions and 608 deletions
+2 -8
View File
@@ -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) {