summaryrefslogtreecommitdiffstats
path: root/Core
diff options
context:
space:
mode:
Diffstat (limited to 'Core')
-rw-r--r--Core/Util/SecureRandom.php7
-rw-r--r--Core/Util/SecureRandomInterface.php31
2 files changed, 33 insertions, 5 deletions
diff --git a/Core/Util/SecureRandom.php b/Core/Util/SecureRandom.php
index 14a1f3d..77f1d8c 100644
--- a/Core/Util/SecureRandom.php
+++ b/Core/Util/SecureRandom.php
@@ -19,7 +19,7 @@ use Symfony\Component\HttpKernel\Log\LoggerInterface;
* @author Fabien Potencier <fabien@symfony.com>
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
-final class SecureRandom
+final class SecureRandom implements SecureRandomInterface
{
private $logger;
private $useOpenSsl;
@@ -56,10 +56,7 @@ final class SecureRandom
}
/**
- * Generates the specified number of secure random bytes.
- *
- * @param integer $nbBytes
- * @return string
+ * {@inheritdoc}
*/
public function nextBytes($nbBytes)
{
diff --git a/Core/Util/SecureRandomInterface.php b/Core/Util/SecureRandomInterface.php
new file mode 100644
index 0000000..f2d8175
--- /dev/null
+++ b/Core/Util/SecureRandomInterface.php
@@ -0,0 +1,31 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Security\Core\Util;
+
+use Symfony\Component\HttpKernel\Log\LoggerInterface;
+
+/**
+ * A secure random number generator implementation.
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+interface SecureRandomInterface
+{
+ /**
+ * Generates the specified number of secure random bytes.
+ *
+ * @param integer $nbBytes
+ *
+ * @return string
+ */
+ public function nextBytes($nbBytes);
+}