mirror of
https://github.com/ramsey/uuid.git
synced 2026-06-27 17:56:36 +03:00
Clean up code according to PhpStorm inspections report
This commit is contained in:
@@ -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)
|
||||
{
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user