diff options
Diffstat (limited to 'vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php')
-rw-r--r-- | vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php b/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php new file mode 100644 index 000000000..2070db142 --- /dev/null +++ b/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php @@ -0,0 +1,47 @@ +<?php + +/* + * This file is part of the Prophecy. + * (c) Konstantin Kudryashov <[email protected]> + * Marcello Duarte <[email protected]> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Prophecy\Comparator; + +use SebastianBergmann\Comparator\Factory as BaseFactory; + +/** + * Prophecy comparator factory. + * + * @author Konstantin Kudryashov <[email protected]> + */ +final class Factory extends BaseFactory +{ + /** + * @var Factory + */ + private static $instance; + + public function __construct() + { + parent::__construct(); + + $this->register(new ClosureComparator()); + $this->register(new ProphecyComparator()); + } + + /** + * @return Factory + */ + public static function getInstance() + { + if (self::$instance === null) { + self::$instance = new Factory; + } + + return self::$instance; + } +} |