infrastructure/Assetic/Factory/Resource/DirectoryResourceIterator.php line 42

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4. * This file is part of the Symfony framework.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. *
  8. * This source file is subject to the MIT license that is bundled
  9. * with this source code in the file LICENSE.
  10. */
  11. namespace Symfony\Bundle\AsseticBundle\Factory\Resource;
  12. use Symfony\Component\Templating\Loader\LoaderInterface;
  13. class DirectoryResourceIterator extends \RecursiveIteratorIterator
  14. {
  15. protected \Symfony\Component\Templating\Loader\LoaderInterface $loader;
  16. protected $bundle;
  17. protected $path;
  18. /**
  19. * Constructor.
  20. *
  21. * @param LoaderInterface $loader The templating loader
  22. * @param string $bundle The current bundle name
  23. * @param string $path The directory
  24. * @param \RecursiveIterator $iterator The inner iterator
  25. */
  26. public function __construct(LoaderInterface $loader, $bundle, $path, \RecursiveIterator $iterator)
  27. {
  28. $this->loader = $loader;
  29. $this->bundle = $bundle;
  30. $this->path = $path;
  31. parent::__construct($iterator);
  32. }
  33. public function current()
  34. {
  35. $file = parent::current();
  36. return new FileResource($this->loader, $this->bundle, $this->path, $file->getPathname());
  37. }
  38. }