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

Breadcrumb

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

function LazyDouble::getInstance

Creates double instance or returns already created one.

Return value

T&DoubleInterface

File

vendor/phpspec/prophecy/src/Prophecy/Doubler/LazyDouble.php, line 138

Class

LazyDouble
Lazy double. Gives simple interface to describe double before creating it.

Namespace

Prophecy\Doubler

Code

public function getInstance() {
    if (null === $this->double) {
        if (null !== $this->arguments) {
            return $this->double = $this->doubler
                ->double($this->class, $this->interfaces, $this->arguments);
        }
        $this->double = $this->doubler
            ->double($this->class, $this->interfaces);
    }
    return $this->double;
}

API Navigation

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