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

Breadcrumb

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

function LazyUuidFromString::getBytes

@psalm-suppress MoreSpecificReturnType @psalm-suppress LessSpecificReturnStatement we know that { we know that {

Overrides UuidInterface::getBytes

See also

self::$uuid} is a non-empty string, so

hex2bin} will retrieve a non-empty string too.

File

vendor/ramsey/uuid/src/Lazy/LazyUuidFromString.php, line 268

Class

LazyUuidFromString
Lazy version of a UUID: its format has not been determined yet, so it is mostly only usable for string/bytes conversion. This object optimizes instantiation, serialization and string conversion time, at the cost of increased overhead for more advanced…

Namespace

Ramsey\Uuid\Lazy

Code

public function getBytes() : string {
    
    /** @phpstan-ignore-next-line PHPStan complains that this is not a non-empty-string. */
    return (string) hex2bin(str_replace('-', '', $this->uuid));
}

API Navigation

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