0cbae14b88b786ee0df04a41c597acb48a738e3b
[yaffs-website] / vendor / symfony / finder / Tests / FakeAdapter / DummyAdapter.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Finder\Tests\FakeAdapter;
13
14 use Symfony\Component\Finder\Adapter\AbstractAdapter;
15
16 /**
17  * @author Jean-François Simon <contact@jfsimon.fr>
18  */
19 class DummyAdapter extends AbstractAdapter
20 {
21     /**
22      * @var \Iterator
23      */
24     private $iterator;
25
26     /**
27      * @param \Iterator $iterator
28      */
29     public function __construct(\Iterator $iterator)
30     {
31         $this->iterator = $iterator;
32     }
33
34     /**
35      * {@inheritdoc}
36      */
37     public function searchInDirectory($dir)
38     {
39         return $this->iterator;
40     }
41
42     /**
43      * {@inheritdoc}
44      */
45     public function getName()
46     {
47         return 'yes';
48     }
49
50     /**
51      * {@inheritdoc}
52      */
53     protected function canBeUsed()
54     {
55         return true;
56     }
57 }