MagentoFinder.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /*
  3. * This file is part of the PHP CS utility.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Symfony\CS\Finder;
  11. /**
  12. * @author Myke Hines <myke@webhines.com>
  13. */
  14. class MagentoFinder extends DefaultFinder
  15. {
  16. public function __construct()
  17. {
  18. @trigger_error(
  19. sprintf('The "%s" class is deprecated. You should stop using it, as it will soon be removed in 2.0 version.', __CLASS__),
  20. E_USER_DEPRECATED
  21. );
  22. parent::__construct();
  23. $this
  24. ->name('*.php')
  25. ->name('*.phtml')
  26. ->name('*.xml')
  27. ->exclude(
  28. array(
  29. 'lib',
  30. 'shell',
  31. 'app/Mage.php',
  32. 'app/code/core',
  33. 'app/code/community',
  34. 'app/design/frontend/default',
  35. 'app/design/frontend/enterprise/default',
  36. 'app/design/frontend/base',
  37. 'app/design/adminhtml/default',
  38. )
  39. )
  40. ;
  41. }
  42. public function setDir($dir)
  43. {
  44. $this->in($this->getDirs($dir));
  45. }
  46. /**
  47. * Gets the directories that needs to be scanned for files to validate.
  48. *
  49. * @param string $dir
  50. *
  51. * @return array
  52. */
  53. protected function getDirs($dir)
  54. {
  55. return array($dir);
  56. }
  57. /**
  58. * Excludes files because modifying them would break.
  59. *
  60. * This is mainly useful for fixtures in unit tests.
  61. *
  62. * @return array
  63. */
  64. protected function getFilesToExclude()
  65. {
  66. return array();
  67. }
  68. }