RandomGeneratorFactory.php 705 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * This file is part of the ramsey/uuid library
  4. *
  5. * For the full copyright and license information, please view the LICENSE
  6. * file that was distributed with this source code.
  7. *
  8. * @copyright Copyright (c) Ben Ramsey <ben@benramsey.com>
  9. * @license http://opensource.org/licenses/MIT MIT
  10. */
  11. declare(strict_types=1);
  12. namespace Ramsey\Uuid\Generator;
  13. /**
  14. * RandomGeneratorFactory retrieves a default random generator, based on the environment
  15. */
  16. class RandomGeneratorFactory
  17. {
  18. /**
  19. * Returns a default random generator, based on the current environment
  20. */
  21. public function getGenerator(): RandomGeneratorInterface
  22. {
  23. return new RandomBytesGenerator();
  24. }
  25. }