Deprecate Uuid::setFactory() and Uuid::getFactory()

This commit is contained in:
Ben Ramsey
2022-08-05 17:28:37 -05:00
parent 55693967d7
commit 7b3eaf32c7
3 changed files with 76 additions and 7 deletions
+67 -6
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.10.0@916b098b008f6de4543892b1e0651c1c3b92cbfa">
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
<file src="src/Builder/DegradedUuidBuilder.php">
<DeprecatedClass occurrences="3">
<code>DegradedUuid</code>
@@ -38,14 +38,18 @@
<code>BigNumberTimeConverter</code>
</DeprecatedClass>
</file>
<file src="src/DegradedUuid.php">
<DeprecatedMethod occurrences="1">
<code>Uuid</code>
</DeprecatedMethod>
</file>
<file src="src/FeatureSet.php">
<PropertyNotSetInConstructor occurrences="6">
<PropertyNotSetInConstructor occurrences="5">
<code>$calculator</code>
<code>$dceSecurityGenerator</code>
<code>$numberConverter</code>
<code>$timeConverter</code>
<code>$timeGenerator</code>
<code>$timeProvider</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/Fields/SerializableFieldsTrait.php">
@@ -60,6 +64,11 @@
<code>uuid_parse</code>
</ImpureFunctionCall>
</file>
<file src="src/Guid/Guid.php">
<DeprecatedMethod occurrences="1">
<code>parent::__construct($fields, $numberConverter, $codec, $timeConverter)</code>
</DeprecatedMethod>
</file>
<file src="src/Guid/GuidBuilder.php">
<ImpureVariable occurrences="3">
<code>$this</code>
@@ -72,6 +81,11 @@
<code>unserialize</code>
</UnusedMethodCall>
</file>
<file src="src/Nonstandard/Uuid.php">
<DeprecatedMethod occurrences="1">
<code>parent::__construct($fields, $numberConverter, $codec, $timeConverter)</code>
</DeprecatedMethod>
</file>
<file src="src/Nonstandard/UuidBuilder.php">
<ImpureVariable occurrences="3">
<code>$this</code>
@@ -79,6 +93,11 @@
<code>$this</code>
</ImpureVariable>
</file>
<file src="src/Nonstandard/UuidV6.php">
<DeprecatedMethod occurrences="1">
<code>parent::__construct($fields, $numberConverter, $codec, $timeConverter)</code>
</DeprecatedMethod>
</file>
<file src="src/Provider/Dce/SystemDceSecurityProvider.php">
<ForbiddenCode occurrences="5">
<code>shell_exec('id -g')</code>
@@ -92,13 +111,15 @@
<MixedArgument occurrences="1">
<code>$macs</code>
</MixedArgument>
<MixedArrayAccess occurrences="1">
<code>$macs</code>
</MixedArrayAccess>
<MixedArrayAssignment occurrences="1">
<code>$macs[]</code>
</MixedArrayAssignment>
</file>
<file src="src/Rfc4122/NilUuid.php">
<DeprecatedMethod occurrences="1">
<code>Uuid</code>
</DeprecatedMethod>
</file>
<file src="src/Rfc4122/UuidBuilder.php">
<ImpureVariable occurrences="15">
<code>$this</code>
@@ -118,6 +139,31 @@
<code>$this</code>
</ImpureVariable>
</file>
<file src="src/Rfc4122/UuidV1.php">
<DeprecatedMethod occurrences="1">
<code>parent::__construct($fields, $numberConverter, $codec, $timeConverter)</code>
</DeprecatedMethod>
</file>
<file src="src/Rfc4122/UuidV2.php">
<DeprecatedMethod occurrences="1">
<code>parent::__construct($fields, $numberConverter, $codec, $timeConverter)</code>
</DeprecatedMethod>
</file>
<file src="src/Rfc4122/UuidV3.php">
<DeprecatedMethod occurrences="1">
<code>parent::__construct($fields, $numberConverter, $codec, $timeConverter)</code>
</DeprecatedMethod>
</file>
<file src="src/Rfc4122/UuidV4.php">
<DeprecatedMethod occurrences="1">
<code>parent::__construct($fields, $numberConverter, $codec, $timeConverter)</code>
</DeprecatedMethod>
</file>
<file src="src/Rfc4122/UuidV5.php">
<DeprecatedMethod occurrences="1">
<code>parent::__construct($fields, $numberConverter, $codec, $timeConverter)</code>
</DeprecatedMethod>
</file>
<file src="src/Type/Decimal.php">
<UnusedMethodCall occurrences="1">
<code>unserialize</code>
@@ -139,6 +185,21 @@
</UnusedMethodCall>
</file>
<file src="src/Uuid.php">
<DeprecatedMethod occurrences="13">
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
<code>self::getFactory()</code>
</DeprecatedMethod>
<ImpureMethodCall occurrences="6">
<code>getFactory</code>
<code>getFactory</code>
+1 -1
View File
@@ -4,7 +4,7 @@
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorLevel="1"
cacheDirectory="./build/cache/psalm"
errorBaseline="./psalm-baseline.xml">
errorBaseline="psalm-baseline.xml">
<projectFiles>
<directory name="./src" />
+8
View File
@@ -403,6 +403,9 @@ class Uuid implements UuidInterface
/**
* Returns the factory used to create UUIDs
*
* @deprecated ramsey/uuid version 5 will no longer support getting a
* factory instance from the base Ramsey\Uuid\Uuid class.
*/
public static function getFactory(): UuidFactoryInterface
{
@@ -416,6 +419,11 @@ class Uuid implements UuidInterface
/**
* Sets the factory used to create UUIDs
*
* @deprecated ramsey/uuid version 5 will no longer support setting a
* factory instance on the base Ramsey\Uuid\Uuid class. If you need to
* customize the properties used to build a UUID, use one of the
* dedicated factories that version 5 will introduce.
*
* @param UuidFactoryInterface $factory A factory that will be used by this
* class to create UUIDs
*/