MagentoFinder.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. * @deprecated
  15. */
  16. class MagentoFinder extends DefaultFinder
  17. {
  18. public function __construct()
  19. {
  20. @trigger_error(
  21. sprintf(
  22. 'The "%s" class is deprecated. You should stop using it, as it will soon be removed in 2.0 version. Use "%s" instead.',
  23. __CLASS__,
  24. 'Symfony\CS\Finder'
  25. ),
  26. E_USER_DEPRECATED
  27. );
  28. parent::__construct();
  29. $this
  30. ->name('*.php')
  31. ->name('*.phtml')
  32. ->name('*.xml')
  33. ->exclude(
  34. array(
  35. 'lib',
  36. 'shell',
  37. 'app/Mage.php',
  38. 'app/code/core',
  39. 'app/code/community',
  40. 'app/design/frontend/default',
  41. 'app/design/frontend/enterprise/default',
  42. 'app/design/frontend/base',
  43. 'app/design/adminhtml/default',
  44. )
  45. )
  46. ;
  47. }
  48. public function setDir($dir)
  49. {
  50. $this->in($this->getDirs($dir));
  51. }
  52. /**
  53. * Gets the directories that needs to be scanned for files to validate.
  54. *
  55. * @param string $dir
  56. *
  57. * @return array
  58. */
  59. protected function getDirs($dir)
  60. {
  61. return array($dir);
  62. }
  63. /**
  64. * Excludes files because modifying them would break.
  65. *
  66. * This is mainly useful for fixtures in unit tests.
  67. *
  68. * @return array
  69. */
  70. protected function getFilesToExclude()
  71. {
  72. return array();
  73. }
  74. }