Version 1
[yaffs-website] / vendor / phpspec / prophecy / src / Prophecy / Comparator / Factory.php
diff --git a/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php b/vendor/phpspec/prophecy/src/Prophecy/Comparator/Factory.php
new file mode 100644 (file)
index 0000000..2070db1
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+
+/*
+ * This file is part of the Prophecy.
+ * (c) Konstantin Kudryashov <ever.zet@gmail.com>
+ *     Marcello Duarte <marcello.duarte@gmail.com>
+ *
+ * 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 <ever.zet@gmail.com>
+ */
+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;
+    }
+}