Skip to content

Instantly share code, notes, and snippets.

@alahtarin
Created December 28, 2017 10:25
Show Gist options
  • Save alahtarin/4b951af895f7d27a2603e7d1461a05b9 to your computer and use it in GitHub Desktop.
Save alahtarin/4b951af895f7d27a2603e7d1461a05b9 to your computer and use it in GitHub Desktop.
<?php
namespace App\Service;
use Ramsey\Uuid\Uuid;
/**
* Class RidProvider
*/
class RidProvider
{
/**
* @var string
*/
private static $rid;
/**
* RidProvider constructor.
*/
private function __construct()
{
}
/**
* @return string
*/
public static function getRid(): string
{
if (empty(self::$rid)) {
self::$rid = (string) Uuid::uuid4();
}
return self::$rid;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment