NamedAdapter.php 986 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 NamedAdapter extends AbstractAdapter
  16. {
  17. /**
  18. * @var string
  19. */
  20. private $name;
  21. /**
  22. * @param string $name
  23. */
  24. public function __construct($name)
  25. {
  26. $this->name = $name;
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function searchInDirectory($dir)
  32. {
  33. return new \ArrayIterator(array());
  34. }
  35. /**
  36. * {@inheritdoc}
  37. */
  38. public function getName()
  39. {
  40. return $this->name;
  41. }
  42. /**
  43. * {@inheritdoc}
  44. */
  45. protected function canBeUsed()
  46. {
  47. return true;
  48. }
  49. }