diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 817b034..e972afa 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -240,6 +240,10 @@ + + + + diff --git a/src/Codec/GuidStringCodec.php b/src/Codec/GuidStringCodec.php index 40d8d71..bbc6d60 100644 --- a/src/Codec/GuidStringCodec.php +++ b/src/Codec/GuidStringCodec.php @@ -16,6 +16,9 @@ namespace Ramsey\Uuid\Codec; use Ramsey\Uuid\UuidInterface; +use function bin2hex; +use function substr; + /** * GuidStringCodec encodes and decodes globally unique identifiers (GUID) * diff --git a/src/Codec/OrderedTimeCodec.php b/src/Codec/OrderedTimeCodec.php index 540dd57..61200e9 100644 --- a/src/Codec/OrderedTimeCodec.php +++ b/src/Codec/OrderedTimeCodec.php @@ -20,6 +20,9 @@ use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use function strlen; +use function substr; + /** * OrderedTimeCodec encodes and decodes a UUID, optimizing the byte order for * more efficient storage diff --git a/src/Codec/StringCodec.php b/src/Codec/StringCodec.php index 478daad..2dbf8f9 100644 --- a/src/Codec/StringCodec.php +++ b/src/Codec/StringCodec.php @@ -21,6 +21,12 @@ use Ramsey\Uuid\Rfc4122\FieldsInterface; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\UuidInterface; +use function hex2bin; +use function implode; +use function str_replace; +use function strlen; +use function substr; + /** * StringCodec encodes and decodes RFC 4122 UUIDs * diff --git a/src/Codec/TimestampFirstCombCodec.php b/src/Codec/TimestampFirstCombCodec.php index 4ab58eb..3f53cb1 100644 --- a/src/Codec/TimestampFirstCombCodec.php +++ b/src/Codec/TimestampFirstCombCodec.php @@ -17,6 +17,11 @@ namespace Ramsey\Uuid\Codec; use Ramsey\Uuid\Exception\InvalidUuidStringException; use Ramsey\Uuid\UuidInterface; +use function bin2hex; +use function sprintf; +use function substr; +use function substr_replace; + /** * TimestampFirstCombCodec encodes and decodes COMBs, with the timestamp as the * first 48 bits diff --git a/src/Converter/Time/GenericTimeConverter.php b/src/Converter/Time/GenericTimeConverter.php index bc506eb..6fab086 100644 --- a/src/Converter/Time/GenericTimeConverter.php +++ b/src/Converter/Time/GenericTimeConverter.php @@ -21,6 +21,11 @@ use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Type\IntegerValue; use Ramsey\Uuid\Type\Time; +use function explode; +use function str_pad; + +use const STR_PAD_LEFT; + /** * GenericTimeConverter uses the provided calculator to calculate and convert * time values diff --git a/src/Converter/Time/PhpTimeConverter.php b/src/Converter/Time/PhpTimeConverter.php index e924216..1b1e198 100644 --- a/src/Converter/Time/PhpTimeConverter.php +++ b/src/Converter/Time/PhpTimeConverter.php @@ -21,6 +21,18 @@ use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Type\IntegerValue; use Ramsey\Uuid\Type\Time; +use function count; +use function dechex; +use function explode; +use function ini_get; +use function is_float; +use function is_int; +use function str_pad; +use function strlen; + +use const STR_PAD_LEFT; +use const STR_PAD_RIGHT; + /** * PhpTimeConverter uses built-in PHP functions and standard math operations * available to the PHP programming language to provide facilities for diff --git a/src/DeprecatedUuidMethodsTrait.php b/src/DeprecatedUuidMethodsTrait.php index 23fec83..5c1cfcb 100644 --- a/src/DeprecatedUuidMethodsTrait.php +++ b/src/DeprecatedUuidMethodsTrait.php @@ -23,6 +23,11 @@ use Ramsey\Uuid\Exception\UnsupportedOperationException; use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; use Throwable; +use function str_pad; +use function substr; + +use const STR_PAD_LEFT; + /** * This trait encapsulates deprecated methods for ramsey/uuid; this trait and * its methods will be removed in ramsey/uuid 5.0.0. diff --git a/src/FeatureSet.php b/src/FeatureSet.php index ed82a23..4f23171 100644 --- a/src/FeatureSet.php +++ b/src/FeatureSet.php @@ -47,6 +47,8 @@ use Ramsey\Uuid\Rfc4122\UuidBuilder as Rfc4122UuidBuilder; use Ramsey\Uuid\Validator\GenericValidator; use Ramsey\Uuid\Validator\ValidatorInterface; +use const PHP_INT_SIZE; + /** * FeatureSet detects and exposes available features in the current environment * diff --git a/src/Generator/CombGenerator.php b/src/Generator/CombGenerator.php index cd94503..88ae6ea 100644 --- a/src/Generator/CombGenerator.php +++ b/src/Generator/CombGenerator.php @@ -17,6 +17,15 @@ namespace Ramsey\Uuid\Generator; use Ramsey\Uuid\Converter\NumberConverterInterface; use Ramsey\Uuid\Exception\InvalidArgumentException; +use function bin2hex; +use function explode; +use function hex2bin; +use function microtime; +use function str_pad; +use function substr; + +use const STR_PAD_LEFT; + /** * CombGenerator generates COMBs (combined UUID/timestamp) * diff --git a/src/Generator/DceSecurityGenerator.php b/src/Generator/DceSecurityGenerator.php index 91bfc4e..c7c08de 100644 --- a/src/Generator/DceSecurityGenerator.php +++ b/src/Generator/DceSecurityGenerator.php @@ -21,6 +21,14 @@ use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Type\IntegerValue; use Ramsey\Uuid\Uuid; +use function hex2bin; +use function in_array; +use function pack; +use function str_pad; +use function substr_replace; + +use const STR_PAD_LEFT; + /** * DceSecurityGenerator generates strings of binary data based on a local * domain, local identifier, node ID, clock sequence, and the current time diff --git a/src/Generator/DefaultTimeGenerator.php b/src/Generator/DefaultTimeGenerator.php index 66c23bc..f82d663 100644 --- a/src/Generator/DefaultTimeGenerator.php +++ b/src/Generator/DefaultTimeGenerator.php @@ -22,6 +22,17 @@ use Ramsey\Uuid\Provider\NodeProviderInterface; use Ramsey\Uuid\Provider\TimeProviderInterface; use Throwable; +use function ctype_xdigit; +use function dechex; +use function hex2bin; +use function is_int; +use function pack; +use function random_int; +use function str_pad; +use function strlen; + +use const STR_PAD_LEFT; + /** * DefaultTimeGenerator generates strings of binary data based on a node ID, * clock sequence, and the current time diff --git a/src/Generator/RandomBytesGenerator.php b/src/Generator/RandomBytesGenerator.php index e6e9a19..dcf6ad8 100644 --- a/src/Generator/RandomBytesGenerator.php +++ b/src/Generator/RandomBytesGenerator.php @@ -16,6 +16,8 @@ namespace Ramsey\Uuid\Generator; use Ramsey\Uuid\Exception\RandomSourceException; +use function random_bytes; + /** * RandomBytesGenerator generates strings of random binary data using the * built-in `random_bytes()` PHP function diff --git a/src/Guid/Fields.php b/src/Guid/Fields.php index d396a97..ab2d787 100644 --- a/src/Guid/Fields.php +++ b/src/Guid/Fields.php @@ -23,6 +23,18 @@ use Ramsey\Uuid\Rfc4122\VersionTrait; use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Uuid; +use function bin2hex; +use function dechex; +use function hexdec; +use function pack; +use function sprintf; +use function str_pad; +use function strlen; +use function substr; +use function unpack; + +use const STR_PAD_LEFT; + /** * GUIDs are comprised of a set of named fields, according to RFC 4122 * diff --git a/src/Nonstandard/Fields.php b/src/Nonstandard/Fields.php index 40f9af1..927bc6a 100644 --- a/src/Nonstandard/Fields.php +++ b/src/Nonstandard/Fields.php @@ -20,6 +20,16 @@ use Ramsey\Uuid\Rfc4122\FieldsInterface; use Ramsey\Uuid\Rfc4122\VariantTrait; use Ramsey\Uuid\Type\Hexadecimal; +use function bin2hex; +use function dechex; +use function hexdec; +use function sprintf; +use function str_pad; +use function strlen; +use function substr; + +use const STR_PAD_LEFT; + /** * Nonstandard UUID fields do not conform to the RFC 4122 standard * diff --git a/src/Provider/Dce/SystemDceSecurityProvider.php b/src/Provider/Dce/SystemDceSecurityProvider.php index ce78104..18f0d5e 100644 --- a/src/Provider/Dce/SystemDceSecurityProvider.php +++ b/src/Provider/Dce/SystemDceSecurityProvider.php @@ -18,6 +18,21 @@ use Ramsey\Uuid\Exception\DceSecurityException; use Ramsey\Uuid\Provider\DceSecurityProviderInterface; use Ramsey\Uuid\Type\IntegerValue; +use function constant; +use function escapeshellarg; +use function ini_get; +use function preg_split; +use function shell_exec; +use function str_getcsv; +use function strpos; +use function strrpos; +use function strtolower; +use function strtoupper; +use function substr; +use function trim; + +use const PREG_SPLIT_NO_EMPTY; + /** * SystemDceSecurityProvider retrieves the user or group identifiers from the system */ diff --git a/src/Provider/Node/RandomNodeProvider.php b/src/Provider/Node/RandomNodeProvider.php index 26c3768..e4c10e7 100644 --- a/src/Provider/Node/RandomNodeProvider.php +++ b/src/Provider/Node/RandomNodeProvider.php @@ -17,6 +17,16 @@ namespace Ramsey\Uuid\Provider\Node; use Ramsey\Uuid\Exception\RandomSourceException; use Ramsey\Uuid\Provider\NodeProviderInterface; +use function bin2hex; +use function dechex; +use function hex2bin; +use function hexdec; +use function random_bytes; +use function str_pad; +use function substr; + +use const STR_PAD_LEFT; + /** * RandomNodeProvider generates a random node ID * diff --git a/src/Provider/Node/SystemNodeProvider.php b/src/Provider/Node/SystemNodeProvider.php index dba0ad1..9c19c45 100644 --- a/src/Provider/Node/SystemNodeProvider.php +++ b/src/Provider/Node/SystemNodeProvider.php @@ -16,6 +16,31 @@ namespace Ramsey\Uuid\Provider\Node; use Ramsey\Uuid\Provider\NodeProviderInterface; +use function array_filter; +use function array_map; +use function array_walk; +use function constant; +use function count; +use function file_get_contents; +use function glob; +use function ini_get; +use function is_array; +use function is_readable; +use function ob_get_clean; +use function ob_start; +use function passthru; +use function preg_match; +use function preg_match_all; +use function reset; +use function str_replace; +use function strpos; +use function strtolower; +use function strtoupper; +use function substr; + +use const GLOB_NOSORT; +use const PREG_PATTERN_ORDER; + /** * SystemNodeProvider retrieves the system node ID, if possible * diff --git a/src/Provider/Time/FixedTimeProvider.php b/src/Provider/Time/FixedTimeProvider.php index c60603d..850f38a 100644 --- a/src/Provider/Time/FixedTimeProvider.php +++ b/src/Provider/Time/FixedTimeProvider.php @@ -18,6 +18,8 @@ use Ramsey\Uuid\Exception\InvalidArgumentException; use Ramsey\Uuid\Provider\TimeProviderInterface; use Ramsey\Uuid\Type\Time; +use function array_key_exists; + /** * FixedTimeProvider uses an known time to provide the time * diff --git a/src/Provider/Time/SystemTimeProvider.php b/src/Provider/Time/SystemTimeProvider.php index 93ff01f..8958c48 100644 --- a/src/Provider/Time/SystemTimeProvider.php +++ b/src/Provider/Time/SystemTimeProvider.php @@ -17,6 +17,8 @@ namespace Ramsey\Uuid\Provider\Time; use Ramsey\Uuid\Provider\TimeProviderInterface; use Ramsey\Uuid\Type\Time; +use function gettimeofday; + /** * SystemTimeProvider retrieves the current time using built-in PHP functions */ diff --git a/src/Rfc4122/Fields.php b/src/Rfc4122/Fields.php index a6a5ee0..9d7a589 100644 --- a/src/Rfc4122/Fields.php +++ b/src/Rfc4122/Fields.php @@ -19,6 +19,17 @@ use Ramsey\Uuid\Fields\SerializableFieldsTrait; use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Uuid; +use function bin2hex; +use function dechex; +use function hexdec; +use function sprintf; +use function str_pad; +use function strlen; +use function substr; +use function unpack; + +use const STR_PAD_LEFT; + /** * RFC 4122 variant UUIDs are comprised of a set of named fields * diff --git a/src/Rfc4122/NilTrait.php b/src/Rfc4122/NilTrait.php index 94294e4..f740f4f 100644 --- a/src/Rfc4122/NilTrait.php +++ b/src/Rfc4122/NilTrait.php @@ -14,6 +14,8 @@ declare(strict_types=1); namespace Ramsey\Uuid\Rfc4122; +use function hex2bin; + /** * Provides common functionality for nil UUIDs * diff --git a/src/Rfc4122/UuidV1.php b/src/Rfc4122/UuidV1.php index 7356c3a..4989915 100644 --- a/src/Rfc4122/UuidV1.php +++ b/src/Rfc4122/UuidV1.php @@ -25,6 +25,10 @@ use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; use Ramsey\Uuid\Uuid; use Throwable; +use function str_pad; + +use const STR_PAD_LEFT; + /** * Time-based, or version 1, UUIDs include timestamp, clock sequence, and node * values that are combined into a 128-bit unsigned integer diff --git a/src/Rfc4122/Validator.php b/src/Rfc4122/Validator.php index 2df2c68..ad6d6f0 100644 --- a/src/Rfc4122/Validator.php +++ b/src/Rfc4122/Validator.php @@ -17,6 +17,9 @@ namespace Ramsey\Uuid\Rfc4122; use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Validator\ValidatorInterface; +use function preg_match; +use function str_replace; + /** * Rfc4122\Validator validates strings as UUIDs of the RFC 4122 variant */ diff --git a/src/Rfc4122/VariantTrait.php b/src/Rfc4122/VariantTrait.php index 01726b4..c32a8ce 100644 --- a/src/Rfc4122/VariantTrait.php +++ b/src/Rfc4122/VariantTrait.php @@ -17,6 +17,15 @@ namespace Ramsey\Uuid\Rfc4122; use Ramsey\Uuid\Exception\InvalidBytesException; use Ramsey\Uuid\Uuid; +use function decbin; +use function str_pad; +use function strlen; +use function strpos; +use function substr; +use function unpack; + +use const STR_PAD_LEFT; + /** * Provides common functionality for handling the variant, as defined by RFC 4122 * diff --git a/src/Type/Decimal.php b/src/Type/Decimal.php index c072c06..a64eabd 100644 --- a/src/Type/Decimal.php +++ b/src/Type/Decimal.php @@ -16,6 +16,8 @@ namespace Ramsey\Uuid\Type; use Ramsey\Uuid\Exception\InvalidArgumentException; +use function is_numeric; + /** * A value object representing a decimal * diff --git a/src/Type/Hexadecimal.php b/src/Type/Hexadecimal.php index ee3e952..2d22fc6 100644 --- a/src/Type/Hexadecimal.php +++ b/src/Type/Hexadecimal.php @@ -17,6 +17,9 @@ namespace Ramsey\Uuid\Type; use Ramsey\Uuid\Exception\InvalidArgumentException; use function ctype_xdigit; +use function strpos; +use function strtolower; +use function substr; /** * A value object representing a hexadecimal number diff --git a/src/Type/IntegerValue.php b/src/Type/IntegerValue.php index 2c47453..4735831 100644 --- a/src/Type/IntegerValue.php +++ b/src/Type/IntegerValue.php @@ -17,6 +17,9 @@ namespace Ramsey\Uuid\Type; use Ramsey\Uuid\Exception\InvalidArgumentException; use function ctype_digit; +use function ltrim; +use function strpos; +use function substr; /** * A value object representing an integer diff --git a/src/Uuid.php b/src/Uuid.php index e4489fe..10de927 100644 --- a/src/Uuid.php +++ b/src/Uuid.php @@ -23,6 +23,9 @@ use Ramsey\Uuid\Rfc4122\FieldsInterface as Rfc4122FieldsInterface; use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Type\IntegerValue; +use function str_replace; +use function strcmp; + /** * Represents a RFC 4122 universally unique identifier (UUID) * diff --git a/src/UuidFactory.php b/src/UuidFactory.php index d07da29..93fcb94 100644 --- a/src/UuidFactory.php +++ b/src/UuidFactory.php @@ -30,6 +30,16 @@ use Ramsey\Uuid\Type\IntegerValue; use Ramsey\Uuid\Type\Time; use Ramsey\Uuid\Validator\ValidatorInterface; +use function hash; +use function pack; +use function str_pad; +use function strtolower; +use function substr; +use function substr_replace; +use function unpack; + +use const STR_PAD_LEFT; + class UuidFactory implements UuidFactoryInterface { /** diff --git a/src/Validator/GenericValidator.php b/src/Validator/GenericValidator.php index 87054f7..cb7b486 100644 --- a/src/Validator/GenericValidator.php +++ b/src/Validator/GenericValidator.php @@ -16,6 +16,9 @@ namespace Ramsey\Uuid\Validator; use Ramsey\Uuid\Uuid; +use function preg_match; +use function str_replace; + /** * GenericValidator validates strings as UUIDs of any variant */ diff --git a/tests/BinaryUtilsTest.php b/tests/BinaryUtilsTest.php index 739c956..0497bfd 100644 --- a/tests/BinaryUtilsTest.php +++ b/tests/BinaryUtilsTest.php @@ -6,6 +6,8 @@ namespace Ramsey\Uuid\Test; use Ramsey\Uuid\BinaryUtils; +use function dechex; + class BinaryUtilsTest extends TestCase { /** diff --git a/tests/Builder/DefaultUuidBuilderTest.php b/tests/Builder/DefaultUuidBuilderTest.php index 5325b1c..f64d7cb 100644 --- a/tests/Builder/DefaultUuidBuilderTest.php +++ b/tests/Builder/DefaultUuidBuilderTest.php @@ -12,6 +12,9 @@ use Ramsey\Uuid\Converter\TimeConverterInterface; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Uuid; +use function hex2bin; +use function implode; + class DefaultUuidBuilderTest extends TestCase { public function testBuildCreatesUuid(): void diff --git a/tests/Codec/GuidStringCodecTest.php b/tests/Codec/GuidStringCodecTest.php index e766fa8..c70d572 100644 --- a/tests/Codec/GuidStringCodecTest.php +++ b/tests/Codec/GuidStringCodecTest.php @@ -16,6 +16,9 @@ use Ramsey\Uuid\Guid\GuidBuilder; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\UuidInterface; +use function hex2bin; +use function pack; + class GuidStringCodecTest extends TestCase { /** diff --git a/tests/Codec/OrderedTimeCodecTest.php b/tests/Codec/OrderedTimeCodecTest.php index 614e7bb..fbdddaf 100644 --- a/tests/Codec/OrderedTimeCodecTest.php +++ b/tests/Codec/OrderedTimeCodecTest.php @@ -23,6 +23,10 @@ use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\UuidFactory; use Ramsey\Uuid\UuidInterface; +use function hex2bin; +use function pack; +use function str_replace; + class OrderedTimeCodecTest extends TestCase { /** diff --git a/tests/Codec/StringCodecTest.php b/tests/Codec/StringCodecTest.php index f457d0a..3ded53c 100644 --- a/tests/Codec/StringCodecTest.php +++ b/tests/Codec/StringCodecTest.php @@ -13,6 +13,10 @@ use Ramsey\Uuid\Rfc4122\FieldsInterface; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\UuidInterface; +use function hex2bin; +use function implode; +use function pack; + class StringCodecTest extends TestCase { /** diff --git a/tests/Converter/Time/BigNumberTimeConverterTest.php b/tests/Converter/Time/BigNumberTimeConverterTest.php index cd6f871..f1703c5 100644 --- a/tests/Converter/Time/BigNumberTimeConverterTest.php +++ b/tests/Converter/Time/BigNumberTimeConverterTest.php @@ -10,6 +10,8 @@ use Ramsey\Uuid\Exception\InvalidArgumentException; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Type\Hexadecimal; +use function sprintf; + class BigNumberTimeConverterTest extends TestCase { public function testCalculateTimeReturnsArrayOfTimeSegments(): void diff --git a/tests/Converter/Time/PhpTimeConverterTest.php b/tests/Converter/Time/PhpTimeConverterTest.php index 0bc09aa..eae5599 100644 --- a/tests/Converter/Time/PhpTimeConverterTest.php +++ b/tests/Converter/Time/PhpTimeConverterTest.php @@ -13,6 +13,8 @@ use Ramsey\Uuid\Math\BrickMathCalculator; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Type\Hexadecimal; +use function sprintf; + class PhpTimeConverterTest extends TestCase { public function testCalculateTimeReturnsArrayOfTimeSegments(): void diff --git a/tests/Encoder/TimestampFirstCombCodecTest.php b/tests/Encoder/TimestampFirstCombCodecTest.php index 3544fff..875695f 100644 --- a/tests/Encoder/TimestampFirstCombCodecTest.php +++ b/tests/Encoder/TimestampFirstCombCodecTest.php @@ -13,6 +13,9 @@ use Ramsey\Uuid\Rfc4122\Fields; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\UuidInterface; +use function hex2bin; +use function implode; + class TimestampFirstCombCodecTest extends TestCase { /** diff --git a/tests/Encoder/TimestampLastCombCodecTest.php b/tests/Encoder/TimestampLastCombCodecTest.php index 4c81098..5bd41c2 100644 --- a/tests/Encoder/TimestampLastCombCodecTest.php +++ b/tests/Encoder/TimestampLastCombCodecTest.php @@ -14,6 +14,9 @@ use Ramsey\Uuid\Rfc4122\FieldsInterface; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\UuidInterface; +use function hex2bin; +use function implode; + class TimestampLastCombCodecTest extends TestCase { /** diff --git a/tests/Generator/CombGeneratorTest.php b/tests/Generator/CombGeneratorTest.php index 2f9655c..ee0de3f 100644 --- a/tests/Generator/CombGeneratorTest.php +++ b/tests/Generator/CombGeneratorTest.php @@ -13,6 +13,13 @@ use Ramsey\Uuid\Generator\CombGenerator; use Ramsey\Uuid\Generator\RandomGeneratorInterface; use Ramsey\Uuid\Test\TestCase; +use function bin2hex; +use function dechex; +use function hex2bin; +use function str_pad; + +use const STR_PAD_LEFT; + class CombGeneratorTest extends TestCase { /** diff --git a/tests/Generator/DceSecurityGeneratorTest.php b/tests/Generator/DceSecurityGeneratorTest.php index 751ef18..32f9bb3 100644 --- a/tests/Generator/DceSecurityGeneratorTest.php +++ b/tests/Generator/DceSecurityGeneratorTest.php @@ -22,6 +22,9 @@ use Ramsey\Uuid\Type\IntegerValue; use Ramsey\Uuid\Type\Time; use Ramsey\Uuid\Uuid; +use function bin2hex; +use function substr; + class DceSecurityGeneratorTest extends TestCase { /** diff --git a/tests/Generator/DefaultTimeGeneratorTest.php b/tests/Generator/DefaultTimeGeneratorTest.php index bac066c..4715117 100644 --- a/tests/Generator/DefaultTimeGeneratorTest.php +++ b/tests/Generator/DefaultTimeGeneratorTest.php @@ -22,6 +22,8 @@ use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Type\Time; +use function hex2bin; + class DefaultTimeGeneratorTest extends TestCase { /** diff --git a/tests/Generator/RandomBytesGeneratorTest.php b/tests/Generator/RandomBytesGeneratorTest.php index 32b6d8b..83b8fbc 100644 --- a/tests/Generator/RandomBytesGeneratorTest.php +++ b/tests/Generator/RandomBytesGeneratorTest.php @@ -10,6 +10,8 @@ use Ramsey\Uuid\Exception\RandomSourceException; use Ramsey\Uuid\Generator\RandomBytesGenerator; use Ramsey\Uuid\Test\TestCase; +use function hex2bin; + class RandomBytesGeneratorTest extends TestCase { /** diff --git a/tests/Guid/FieldsTest.php b/tests/Guid/FieldsTest.php index 0e68215..3e39c59 100644 --- a/tests/Guid/FieldsTest.php +++ b/tests/Guid/FieldsTest.php @@ -9,6 +9,10 @@ use Ramsey\Uuid\Guid\Fields; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Type\Hexadecimal; +use function hex2bin; +use function serialize; +use function unserialize; + class FieldsTest extends TestCase { public function testConstructorThrowsExceptionIfNotSixteenByteString(): void diff --git a/tests/Nonstandard/FieldsTest.php b/tests/Nonstandard/FieldsTest.php index 6523177..842cd8a 100644 --- a/tests/Nonstandard/FieldsTest.php +++ b/tests/Nonstandard/FieldsTest.php @@ -10,6 +10,11 @@ use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\Uuid; +use function hex2bin; +use function serialize; +use function str_replace; +use function unserialize; + class FieldsTest extends TestCase { public function testConstructorThrowsExceptionIfNotSixteenByteString(): void diff --git a/tests/Provider/Dce/SystemDceSecurityProviderTest.php b/tests/Provider/Dce/SystemDceSecurityProviderTest.php index 092d14f..b129289 100644 --- a/tests/Provider/Dce/SystemDceSecurityProviderTest.php +++ b/tests/Provider/Dce/SystemDceSecurityProviderTest.php @@ -10,6 +10,8 @@ use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Type\IntegerValue; use phpmock\mockery\PHPMockery; +use function array_merge; + class SystemDceSecurityProviderTest extends TestCase { /** diff --git a/tests/Provider/Node/RandomNodeProviderTest.php b/tests/Provider/Node/RandomNodeProviderTest.php index 5d02785..93867cf 100644 --- a/tests/Provider/Node/RandomNodeProviderTest.php +++ b/tests/Provider/Node/RandomNodeProviderTest.php @@ -10,6 +10,12 @@ use Ramsey\Uuid\Exception\RandomSourceException; use Ramsey\Uuid\Provider\Node\RandomNodeProvider; use Ramsey\Uuid\Test\TestCase; +use function bin2hex; +use function hex2bin; +use function hexdec; +use function sprintf; +use function substr; + class RandomNodeProviderTest extends TestCase { protected function tearDown(): void diff --git a/tests/Provider/Node/SystemNodeProviderTest.php b/tests/Provider/Node/SystemNodeProviderTest.php index 86e940b..61a251f 100644 --- a/tests/Provider/Node/SystemNodeProviderTest.php +++ b/tests/Provider/Node/SystemNodeProviderTest.php @@ -10,6 +10,13 @@ use Ramsey\Uuid\Exception\InvalidArgumentException; use Ramsey\Uuid\Provider\Node\SystemNodeProvider; use Ramsey\Uuid\Test\TestCase; +use function array_shift; +use function array_walk; +use function gettype; +use function is_array; +use function strlen; +use function vsprintf; + /** * Tests for the SystemNodeProvider class * diff --git a/tests/Rfc4122/FieldsTest.php b/tests/Rfc4122/FieldsTest.php index a79ee8a..0c57396 100644 --- a/tests/Rfc4122/FieldsTest.php +++ b/tests/Rfc4122/FieldsTest.php @@ -9,6 +9,11 @@ use Ramsey\Uuid\Rfc4122\Fields; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Type\Hexadecimal; +use function hex2bin; +use function serialize; +use function str_replace; +use function unserialize; + class FieldsTest extends TestCase { public function testConstructorThrowsExceptionIfNotSixteenByteString(): void diff --git a/tests/Rfc4122/UuidBuilderTest.php b/tests/Rfc4122/UuidBuilderTest.php index 1fb2d30..ddcd055 100644 --- a/tests/Rfc4122/UuidBuilderTest.php +++ b/tests/Rfc4122/UuidBuilderTest.php @@ -18,6 +18,9 @@ use Ramsey\Uuid\Rfc4122\UuidV4; use Ramsey\Uuid\Rfc4122\UuidV5; use Ramsey\Uuid\Test\TestCase; +use function hex2bin; +use function str_replace; + class UuidBuilderTest extends TestCase { /** diff --git a/tests/Rfc4122/ValidatorTest.php b/tests/Rfc4122/ValidatorTest.php index 54c943e..2203ba4 100644 --- a/tests/Rfc4122/ValidatorTest.php +++ b/tests/Rfc4122/ValidatorTest.php @@ -7,6 +7,10 @@ namespace Ramsey\Uuid\Test\Rfc4122; use Ramsey\Uuid\Rfc4122\Validator; use Ramsey\Uuid\Test\TestCase; +use function array_merge; +use function in_array; +use function strtoupper; + class ValidatorTest extends TestCase { /** diff --git a/tests/Rfc4122/VariantTraitTest.php b/tests/Rfc4122/VariantTraitTest.php index 08145f1..e5da177 100644 --- a/tests/Rfc4122/VariantTraitTest.php +++ b/tests/Rfc4122/VariantTraitTest.php @@ -9,6 +9,9 @@ use Ramsey\Uuid\Exception\InvalidBytesException; use Ramsey\Uuid\Rfc4122\VariantTrait; use Ramsey\Uuid\Test\TestCase; +use function hex2bin; +use function str_replace; + class VariantTraitTest extends TestCase { /** diff --git a/tests/TestCase.php b/tests/TestCase.php index 87a03b4..84228fe 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -8,6 +8,10 @@ use AspectMock\Test as AspectMock; use Mockery; use PHPUnit\Framework\TestCase as PhpUnitTestCase; +use function current; +use function pack; +use function unpack; + class TestCase extends PhpUnitTestCase { protected function tearDown(): void diff --git a/tests/UuidFactoryTest.php b/tests/UuidFactoryTest.php index 40154ef..edf2c92 100644 --- a/tests/UuidFactoryTest.php +++ b/tests/UuidFactoryTest.php @@ -23,6 +23,9 @@ use Ramsey\Uuid\Type\Hexadecimal; use Ramsey\Uuid\UuidFactory; use Ramsey\Uuid\Validator\ValidatorInterface; +use function hex2bin; +use function strtoupper; + class UuidFactoryTest extends TestCase { public function testParsesUuidCorrectly(): void diff --git a/tests/UuidTest.php b/tests/UuidTest.php index d95f837..3502813 100644 --- a/tests/UuidTest.php +++ b/tests/UuidTest.php @@ -42,7 +42,20 @@ use Ramsey\Uuid\Validator\GenericValidator; use Ramsey\Uuid\Validator\ValidatorInterface; use stdClass; +use function base64_decode; +use function base64_encode; +use function gmdate; +use function hex2bin; +use function json_encode; +use function serialize; +use function str_pad; use function strlen; +use function strtotime; +use function strtoupper; +use function substr; +use function uniqid; +use function unserialize; +use function usleep; class UuidTest extends TestCase { diff --git a/tests/Validator/GenericValidatorTest.php b/tests/Validator/GenericValidatorTest.php index 8e18860..59ba46c 100644 --- a/tests/Validator/GenericValidatorTest.php +++ b/tests/Validator/GenericValidatorTest.php @@ -7,6 +7,9 @@ namespace Ramsey\Uuid\Test\Validator; use Ramsey\Uuid\Test\TestCase; use Ramsey\Uuid\Validator\GenericValidator; +use function array_merge; +use function strtoupper; + class GenericValidatorTest extends TestCase { /**