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

Breadcrumb

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

class ConstantCollection

@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

@psalm-immutable

@template-implements IteratorAggregate<int, Constant>

Hierarchy

  • class \PHPUnit\TextUI\Configuration\ConstantCollection implements \Countable, \IteratorAggregate

Expanded class hierarchy of ConstantCollection

2 files declare their use of ConstantCollection
DefaultConfiguration.php in vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/DefaultConfiguration.php
Loader.php in vendor/phpunit/phpunit/src/TextUI/Configuration/Xml/Loader.php

File

vendor/phpunit/phpunit/src/TextUI/Configuration/Value/ConstantCollection.php, line 23

Namespace

PHPUnit\TextUI\Configuration
View source
final class ConstantCollection implements Countable, IteratorAggregate {
    
    /**
     * @psalm-var list<Constant>
     */
    private readonly array $constants;
    
    /**
     * @psalm-param list<Constant> $constants
     */
    public static function fromArray(array $constants) : self {
        return new self(...$constants);
    }
    private function __construct(Constant ...$constants) {
        $this->constants = $constants;
    }
    
    /**
     * @psalm-return list<Constant>
     */
    public function asArray() : array {
        return $this->constants;
    }
    public function count() : int {
        return count($this->constants);
    }
    public function getIterator() : ConstantCollectionIterator {
        return new ConstantCollectionIterator($this);
    }

}

Members

Title Sort descending Modifiers Object type Summary
ConstantCollection::$constants private property @psalm-var list&lt;Constant&gt;
ConstantCollection::asArray public function @psalm-return list&lt;Constant&gt;
ConstantCollection::count public function
ConstantCollection::fromArray public static function @psalm-param list&lt;Constant&gt; $constants
ConstantCollection::getIterator public function
ConstantCollection::__construct private function

API Navigation

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