mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-24 17:35:57 +03:00
Add docblocks for classes and interfaces in Ramsey\Uuid\Provider namespace
This commit is contained in:
@@ -16,15 +16,34 @@ namespace Ramsey\Uuid\Provider\Node;
|
||||
|
||||
use Ramsey\Uuid\Provider\NodeProviderInterface;
|
||||
|
||||
/**
|
||||
* FallbackNodeProvider attempts to gain the system host ID from an array of
|
||||
* providers, falling back to the next in line in the event a host ID can not be
|
||||
* obtained
|
||||
*/
|
||||
class FallbackNodeProvider implements NodeProviderInterface
|
||||
{
|
||||
/**
|
||||
* @var NodeProviderInterface[]
|
||||
*/
|
||||
private $nodeProviders;
|
||||
|
||||
/**
|
||||
* Constructs a `FallbackNodeProvider` using an array of node providers
|
||||
*
|
||||
* @param NodeProviderInterface[] $providers Array of node providers
|
||||
*/
|
||||
public function __construct(array $providers)
|
||||
{
|
||||
$this->nodeProviders = $providers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the system node ID by iterating over an array of node providers
|
||||
* and returning the first non-empty value found
|
||||
*
|
||||
* @return string System node ID as a hexadecimal string
|
||||
*/
|
||||
public function getNode()
|
||||
{
|
||||
foreach ($this->nodeProviders as $provider) {
|
||||
|
||||
Reference in New Issue
Block a user