diff options
author | Mario <mario@mariovavti.com> | 2020-11-05 08:46:42 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-11-05 08:46:42 +0000 |
commit | bafbf0416462c6f18c3fb6c8c06a063c8d6fdae6 (patch) | |
tree | 8929845be585b09d0f420621281c5531e1efad3e /vendor/ramsey/uuid/src/Codec/StringCodec.php | |
parent | 6f93d9848c43019d43ea76c27d42d657ba031cd7 (diff) | |
parent | fdefa101d84dc2a9424eaedbdb003a4c30ec5d01 (diff) | |
download | volse-hubzilla-bafbf0416462c6f18c3fb6c8c06a063c8d6fdae6.tar.gz volse-hubzilla-bafbf0416462c6f18c3fb6c8c06a063c8d6fdae6.tar.bz2 volse-hubzilla-bafbf0416462c6f18c3fb6c8c06a063c8d6fdae6.zip |
Merge branch '5.0RC'5.0
Diffstat (limited to 'vendor/ramsey/uuid/src/Codec/StringCodec.php')
-rw-r--r-- | vendor/ramsey/uuid/src/Codec/StringCodec.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vendor/ramsey/uuid/src/Codec/StringCodec.php b/vendor/ramsey/uuid/src/Codec/StringCodec.php index 7f352065c..f1bc0249a 100644 --- a/vendor/ramsey/uuid/src/Codec/StringCodec.php +++ b/vendor/ramsey/uuid/src/Codec/StringCodec.php @@ -74,7 +74,7 @@ class StringCodec implements CodecInterface * * @param string $encodedUuid * @return UuidInterface - * @throws \Ramsey\Uuid\Exception\InvalidUuidStringException + * @throws InvalidUuidStringException */ public function decode($encodedUuid) { @@ -89,7 +89,7 @@ class StringCodec implements CodecInterface * * @param string $bytes * @return UuidInterface - * @throws \InvalidArgumentException if string has not 16 characters + * @throws InvalidArgumentException if string has not 16 characters */ public function decodeBytes($bytes) { @@ -117,28 +117,28 @@ class StringCodec implements CodecInterface * * @param string $encodedUuid * @return array - * @throws \Ramsey\Uuid\Exception\InvalidUuidStringException + * @throws InvalidUuidStringException */ protected function extractComponents($encodedUuid) { - $nameParsed = str_replace(array( + $nameParsed = str_replace([ 'urn:', 'uuid:', '{', '}', '-' - ), '', $encodedUuid); + ], '', $encodedUuid); // We have stripped out the dashes and are breaking up the string using // substr(). In this way, we can accept a full hex value that doesn't // contain dashes. - $components = array( + $components = [ substr($nameParsed, 0, 8), substr($nameParsed, 8, 4), substr($nameParsed, 12, 4), substr($nameParsed, 16, 4), substr($nameParsed, 20) - ); + ]; $nameParsed = implode('-', $components); @@ -158,13 +158,13 @@ class StringCodec implements CodecInterface */ protected function getFields(array $components) { - return array( + return [ 'time_low' => str_pad($components[0], 8, '0', STR_PAD_LEFT), 'time_mid' => str_pad($components[1], 4, '0', STR_PAD_LEFT), 'time_hi_and_version' => str_pad($components[2], 4, '0', STR_PAD_LEFT), 'clock_seq_hi_and_reserved' => str_pad(substr($components[3], 0, 2), 2, '0', STR_PAD_LEFT), 'clock_seq_low' => str_pad(substr($components[3], 2), 2, '0', STR_PAD_LEFT), 'node' => str_pad($components[4], 12, '0', STR_PAD_LEFT) - ); + ]; } } |