Applied automated CS fixes according to project CS settings

This commit is contained in:
Marco Pivetta
2020-06-30 15:19:15 +02:00
parent c01872212e
commit 1ce3f55673
4 changed files with 8 additions and 10 deletions
+5 -2
View File
@@ -24,6 +24,7 @@ use Ramsey\Uuid\Type\Hexadecimal;
use Ramsey\Uuid\Type\Integer as IntegerObject;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use function assert;
use function hex2bin;
use function str_replace;
@@ -33,10 +34,10 @@ use function str_replace;
* conversion. This object optimizes instantiation, serialization and string conversion time, at the cost of
* increased overhead for more advanced UUID operations.
*
* @psalm-immutable
*
* @internal this type is used internally for performance reasons, and is not supposed to be directly referenced
* in consumer libraries.
*
* @psalm-immutable
*/
final class LazyUuidFromString implements UuidInterface
{
@@ -56,6 +57,7 @@ final class LazyUuidFromString implements UuidInterface
return $this->uuid;
}
/** {@inheritDoc} */
public function unserialize($serialized): void
{
$this->uuid = $serialized;
@@ -67,6 +69,7 @@ final class LazyUuidFromString implements UuidInterface
->getNumberConverter();
}
/** {@inheritDoc} */
public function getFieldsHex(): array
{
return $this->unwrap()
+2 -1
View File
@@ -389,6 +389,7 @@ class Uuid implements UuidInterface
{
// Note: non-string equality is intentional here. If the factory is configured differently, every assumption
// around purity is broken, and we have to internally decide everything differently.
// phpcs:ignore SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator
self::$factoryReplaced = ($factory != new UuidFactory());
self::$factory = $factory;
@@ -411,7 +412,7 @@ class Uuid implements UuidInterface
$base16Uuid = bin2hex($bytes);
return self::fromString(
substr($base16Uuid,0, 8)
substr($base16Uuid, 0, 8)
. '-'
. substr($base16Uuid, 8, 4)
. '-'
-2
View File
@@ -24,12 +24,10 @@ use Ramsey\Uuid\Generator\CombGenerator;
use Ramsey\Uuid\Generator\RandomGeneratorFactory;
use Ramsey\Uuid\Generator\RandomGeneratorInterface;
use Ramsey\Uuid\Guid\Guid;
use Ramsey\Uuid\Nonstandard\Uuid as NonstandardUuid;
use Ramsey\Uuid\Nonstandard\UuidV6;
use Ramsey\Uuid\Provider\Node\RandomNodeProvider;
use Ramsey\Uuid\Provider\Time\FixedTimeProvider;
use Ramsey\Uuid\Rfc4122\FieldsInterface;
use Ramsey\Uuid\Rfc4122\NilUuid;
use Ramsey\Uuid\Rfc4122\UuidV1;
use Ramsey\Uuid\Rfc4122\UuidV2;
use Ramsey\Uuid\Rfc4122\UuidV3;
@@ -16,6 +16,7 @@ namespace Ramsey\Uuid\Benchmark;
use Ramsey\Uuid\Uuid;
use Ramsey\Uuid\UuidInterface;
use function array_map;
final class UuidStringConversionBench
@@ -132,31 +133,26 @@ final class UuidStringConversionBench
private $uuid;
/**
* @var UuidInterface
*
* @psalm-var non-empty-list<UuidInterface>
*/
private $promiscuousUuids;
/**
* @var string
*
* @psalm-var non-empty-string
*/
private $tinyUuidBytes;
/**
* @var string
*
* @psalm-var non-empty-string
*/
private $hugeUuidBytes;
/**
* @var string
*
* @psalm-var non-empty-string
*/
private $uuidBytes;
/**
* @var string
*
* @psalm-var non-empty-list<non-empty-string>
*/
private $promiscuousUuidsBytes;