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

Breadcrumb

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

class BuilderCollection

A collection of UuidBuilderInterface objects

@extends AbstractCollection<UuidBuilderInterface>

Hierarchy

  • class \Ramsey\Collection\AbstractArray implements \Ramsey\Collection\ArrayInterface
    • class \Ramsey\Collection\AbstractCollection extends \Ramsey\Collection\AbstractArray implements \Ramsey\Collection\CollectionInterface uses \Ramsey\Collection\Tool\TypeTrait, \Ramsey\Collection\Tool\ValueToStringTrait, \Ramsey\Collection\Tool\ValueExtractorTrait
      • class \Ramsey\Uuid\Builder\BuilderCollection extends \Ramsey\Collection\AbstractCollection

Expanded class hierarchy of BuilderCollection

Deprecated

this class has been deprecated, and will be removed in 5.0.0. The use-case for this class comes from a pre-`phpstan/phpstan` and pre-`vimeo/psalm` ecosystem, in which type safety had to be mostly enforced at runtime: that is no longer necessary, now that you can safely verify your code to be correct, and use more generic types like `iterable<T>` instead.

File

vendor/ramsey/uuid/src/Builder/BuilderCollection.php, line 37

Namespace

Ramsey\Uuid\Builder
View source
class BuilderCollection extends AbstractCollection {
    public function getType() : string {
        return UuidBuilderInterface::class;
    }
    
    /**
     * @psalm-mutation-free
     * @psalm-suppress ImpureMethodCall
     * @psalm-suppress InvalidTemplateParam
     */
    public function getIterator() : Traversable {
        return parent::getIterator();
    }
    
    /**
     * Re-constructs the object from its serialized form
     *
     * @param string $serialized The serialized PHP string to unserialize into
     *     a UuidInterface instance
     *
     * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint
     * @psalm-suppress RedundantConditionGivenDocblockType
     */
    public function unserialize($serialized) : void {
        
        /** @var array<array-key, UuidBuilderInterface> $data */
        $data = unserialize($serialized, [
            'allowed_classes' => [
                BrickMathCalculator::class,
                GenericNumberConverter::class,
                GenericTimeConverter::class,
                GuidBuilder::class,
                NonstandardUuidBuilder::class,
                PhpTimeConverter::class,
                Rfc4122UuidBuilder::class,
            ],
        ]);
        $this->data = array_filter($data, function ($unserialized) : bool {
            return $unserialized instanceof UuidBuilderInterface;
        });
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
AbstractArray::$data protected property The items of this array.
AbstractArray::clear public function Removes all items from this array. Overrides ArrayInterface::clear
AbstractArray::count public function Returns the number of items in this array.
AbstractArray::isEmpty public function Returns `true` if this array is empty. Overrides ArrayInterface::isEmpty
AbstractArray::offsetExists public function Returns `true` if the given offset exists in this array.
AbstractArray::offsetGet public function Returns the value at the specified offset.
AbstractArray::offsetUnset public function Removes the given offset and its value from the array.
AbstractArray::toArray public function @inheritDoc Overrides ArrayInterface::toArray 1
AbstractArray::__construct public function Constructs a new array object. 4
AbstractArray::__serialize public function Returns data suitable for PHP serialization. 1
AbstractArray::__unserialize public function Adds unserialized data to the object.
AbstractCollection::add public function Overrides CollectionInterface::add 1
AbstractCollection::column public function @inheritDoc Overrides CollectionInterface::column
AbstractCollection::compareCollectionTypes private function
AbstractCollection::contains public function Returns `true` if this collection contains the specified element. Overrides CollectionInterface::contains
AbstractCollection::diff public function Overrides CollectionInterface::diff
AbstractCollection::filter public function Overrides CollectionInterface::filter
AbstractCollection::first public function Overrides CollectionInterface::first
AbstractCollection::getComparator private function
AbstractCollection::getUniformType private function
AbstractCollection::intersect public function Overrides CollectionInterface::intersect
AbstractCollection::last public function Overrides CollectionInterface::last
AbstractCollection::map public function @template TCallbackReturn Overrides CollectionInterface::map
AbstractCollection::merge public function Overrides CollectionInterface::merge
AbstractCollection::offsetSet public function Overrides AbstractArray::offsetSet 1
AbstractCollection::reduce public function @template TCarry Overrides CollectionInterface::reduce
AbstractCollection::remove public function Removes a single instance of the specified element from this collection,
if it is present.
Overrides CollectionInterface::remove
AbstractCollection::sort public function Overrides CollectionInterface::sort
AbstractCollection::where public function Overrides CollectionInterface::where
BuilderCollection::getIterator public function @psalm-mutation-free
@psalm-suppress ImpureMethodCall
@psalm-suppress InvalidTemplateParam
Overrides AbstractArray::getIterator
BuilderCollection::getType public function Returns the type associated with this collection. Overrides CollectionInterface::getType
BuilderCollection::unserialize public function Re-constructs the object from its serialized form
TypeTrait::checkType protected function Returns `true` if value is of the specified type.
ValueExtractorTrait::extractValue protected function Extracts the value of the given property, method, or array key from the
element.
ValueToStringTrait::toolValueToString protected function Returns a string representation of the value.
RSS feed
Powered by Drupal