You are here

final class Factory in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/sebastian/comparator/src/Factory.php \SebastianBergmann\Comparator\Factory
  2. 8.0 vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php \Prophecy\Comparator\Factory
Same name and namespace in other branches
  1. 8 vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php \Prophecy\Comparator\Factory

Prophecy comparator factory.

@author Konstantin Kudryashov <ever.zet@gmail.com>

Hierarchy

  • class \SebastianBergmann\Comparator\Factory
    • class \Prophecy\Comparator\Factory

Expanded class hierarchy of Factory

3 files declare their use of Factory
ExactValueToken.php in vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ExactValueToken.php
ObjectProphecy.php in vendor/phpspec/prophecy/src/Prophecy/Prophecy/ObjectProphecy.php
ObjectStateToken.php in vendor/phpspec/prophecy/src/Prophecy/Argument/Token/ObjectStateToken.php

File

vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php, line 21

Namespace

Prophecy\Comparator
View source
final class Factory extends BaseFactory {

  /**
   * @var Factory
   */
  private static $instance;
  public function __construct() {
    parent::__construct();
    $this
      ->register(new ClosureComparator());
  }

  /**
   * @return Factory
   */
  public static function getInstance() {
    if (self::$instance === null) {
      self::$instance = new Factory();
    }
    return self::$instance;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Factory::$comparators private property
Factory::$instance private static property Overrides Factory::$instance
Factory::getComparatorFor public function Returns the correct comparator for comparing two values.
Factory::getInstance public static function Overrides Factory::getInstance
Factory::register public function Registers a new comparator.
Factory::unregister public function Unregisters a comparator.
Factory::__construct public function Constructs a new factory. Overrides Factory::__construct