Drupal investigation

NamedAdapter.php 986B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. }