remove-vendor-prefixing-codemod.php 1000 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Yoast SEO Plugin File.
  4. *
  5. * @package Yoast\YoastSEO\PHP_CodeShift
  6. */
  7. namespace Yoast\WP\Free\PHP_CodeShift;
  8. use Codeshift\AbstractCodemod;
  9. /**
  10. * Class Vendor_Prefixing_Codemod
  11. */
  12. class Remove_Vendor_Prefixing_Codemod extends AbstractCodemod {
  13. /**
  14. * Sets up the environment required to do the code modifications.
  15. */
  16. public function init() {
  17. \define( 'YoastSEO_Vendor\RUCKUSING_BASE', __DIR__ . '/../../fake-ruckusing' );
  18. \define( 'YOAST_VENDOR_NS_PREFIX', 'YoastSEO_Vendor' );
  19. \define( 'YOAST_VENDOR_DEFINE_PREFIX', 'YOASTSEO_VENDOR__' );
  20. \define( 'YOAST_VENDOR_PREFIX_DIRECTORY', 'vendor_prefixed' );
  21. $visitor = new Remove_Vendor_Prefixing_Visitor();
  22. $comment_visitor = new Remove_Vendor_Prefixing_Comment_Visitor();
  23. $array_key_visitor = new Remove_Vendor_Prefixing_Array_Key_Visitor();
  24. $this->addTraversalTransform( $visitor, $comment_visitor, $array_key_visitor );
  25. }
  26. }
  27. return 'Yoast\WP\Free\PHP_CodeShift\Remove_Vendor_Prefixing_Codemod';