DummyAdapter.php 1004 B

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