FilesLoader.php 912 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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\Validator\Tests\Fixtures;
  11. use Symfony\Component\Validator\Mapping\Loader\FilesLoader as BaseFilesLoader;
  12. use Symfony\Component\Validator\Mapping\Loader\LoaderInterface;
  13. abstract class FilesLoader extends BaseFilesLoader
  14. {
  15. protected $timesCalled = 0;
  16. protected $loader;
  17. public function __construct(array $paths, LoaderInterface $loader)
  18. {
  19. $this->loader = $loader;
  20. parent::__construct($paths);
  21. }
  22. protected function getFileLoaderInstance($file)
  23. {
  24. ++$this->timesCalled;
  25. return $this->loader;
  26. }
  27. public function getTimesCalled()
  28. {
  29. return $this->timesCalled;
  30. }
  31. }