Created
December 28, 2017 10:25
-
-
Save alahtarin/4b951af895f7d27a2603e7d1461a05b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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