Version 1
[yaffs-website] / vendor / symfony / polyfill-php54 / Resources / stubs / RecursiveCallbackFilterIterator.php
diff --git a/vendor/symfony/polyfill-php54/Resources/stubs/RecursiveCallbackFilterIterator.php b/vendor/symfony/polyfill-php54/Resources/stubs/RecursiveCallbackFilterIterator.php
new file mode 100644 (file)
index 0000000..63afd38
--- /dev/null
@@ -0,0 +1,33 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+class RecursiveCallbackFilterIterator extends CallbackFilterIterator implements RecursiveIterator
+{
+    private $iterator;
+    private $callback;
+
+    public function __construct(RecursiveIterator $iterator, $callback)
+    {
+        $this->iterator = $iterator;
+        $this->callback = $callback;
+        parent::__construct($iterator, $callback);
+    }
+
+    public function hasChildren()
+    {
+        return $this->iterator->hasChildren();
+    }
+
+    public function getChildren()
+    {
+        return new static($this->iterator->getChildren(), $this->callback);
+    }
+}