aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php')
-rw-r--r--vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php b/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php
index c9969b3af..5c5ccb294 100644
--- a/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php
+++ b/vendor/ramsey/uuid/src/Generator/DefaultTimeGenerator.php
@@ -14,8 +14,11 @@
namespace Ramsey\Uuid\Generator;
+use Exception;
+use InvalidArgumentException;
use Ramsey\Uuid\BinaryUtils;
use Ramsey\Uuid\Converter\TimeConverterInterface;
+use Ramsey\Uuid\Exception\UnsatisfiedDependencyException;
use Ramsey\Uuid\Provider\NodeProviderInterface;
use Ramsey\Uuid\Provider\TimeProviderInterface;
@@ -72,10 +75,10 @@ class DefaultTimeGenerator implements TimeGeneratorInterface
* could arise when the clock is set backwards in time or if the node ID
* changes.
* @return string A binary string
- * @throws \Ramsey\Uuid\Exception\UnsatisfiedDependencyException if called on a 32-bit system and
+ * @throws UnsatisfiedDependencyException if called on a 32-bit system and
* `Moontoast\Math\BigNumber` is not present
- * @throws \InvalidArgumentException
- * @throws \Exception if it was not possible to gather sufficient entropy
+ * @throws InvalidArgumentException
+ * @throws Exception if it was not possible to gather sufficient entropy
*/
public function generate($node = null, $clockSeq = null)
{
@@ -96,14 +99,14 @@ class DefaultTimeGenerator implements TimeGeneratorInterface
$hex = vsprintf(
'%08s%04s%04s%02s%02s%012s',
- array(
+ [
$uuidTime['low'],
$uuidTime['mid'],
sprintf('%04x', $timeHi),
sprintf('%02x', $clockSeqHi),
sprintf('%02x', $clockSeq & 0xff),
$node,
- )
+ ]
);
return hex2bin($hex);
@@ -115,8 +118,8 @@ class DefaultTimeGenerator implements TimeGeneratorInterface
*
* @param string|int $node A node value that may be used to override the node provider
* @return string Hexadecimal representation of the node ID
- * @throws \InvalidArgumentException
- * @throws \Exception
+ * @throws InvalidArgumentException
+ * @throws Exception
*/
protected function getValidNode($node)
{
@@ -130,7 +133,7 @@ class DefaultTimeGenerator implements TimeGeneratorInterface
}
if (!ctype_xdigit($node) || strlen($node) > 12) {
- throw new \InvalidArgumentException('Invalid node value');
+ throw new InvalidArgumentException('Invalid node value');
}
return strtolower(sprintf('%012s', $node));