Clean up code according to PhpStorm inspections report

This commit is contained in:
Ben Ramsey
2019-11-30 13:13:55 -08:00
parent feb3eb50d1
commit 64ba9a2767
38 changed files with 270 additions and 203 deletions
+9 -6
View File
@@ -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));