Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DegradedUuidBuilder.php

class DegradedUuidBuilder

@psalm-immutable

Hierarchy

  • class \Ramsey\Uuid\Builder\DegradedUuidBuilder implements \Ramsey\Uuid\Builder\UuidBuilderInterface

Expanded class hierarchy of DegradedUuidBuilder

Deprecated

DegradedUuid instances are no longer necessary to support 32-bit systems. Transition to {

See also

DefaultUuidBuilder}.

File

vendor/ramsey/uuid/src/Builder/DegradedUuidBuilder.php, line 31

Namespace

Ramsey\Uuid\Builder
View source
class DegradedUuidBuilder implements UuidBuilderInterface {
    private TimeConverterInterface $timeConverter;
    
    /**
     * @param NumberConverterInterface $numberConverter The number converter to
     *     use when constructing the DegradedUuid
     * @param TimeConverterInterface|null $timeConverter The time converter to use
     *     for converting timestamps extracted from a UUID to Unix timestamps
     */
    public function __construct(NumberConverterInterface $numberConverter, ?TimeConverterInterface $timeConverter = null) {
        $this->timeConverter = $timeConverter ?: new DegradedTimeConverter();
    }
    
    /**
     * Builds and returns a DegradedUuid
     *
     * @param CodecInterface $codec The codec to use for building this DegradedUuid instance
     * @param string $bytes The byte string from which to construct a UUID
     *
     * @return DegradedUuid The DegradedUuidBuild returns an instance of Ramsey\Uuid\DegradedUuid
     *
     * @psalm-pure
     */
    public function build(CodecInterface $codec, string $bytes) : UuidInterface {
        return new DegradedUuid(new Rfc4122Fields($bytes), $this->numberConverter, $codec, $this->timeConverter);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
DegradedUuidBuilder::$timeConverter private property
DegradedUuidBuilder::build public function Builds and returns a DegradedUuid Overrides UuidBuilderInterface::build
DegradedUuidBuilder::__construct public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal