PatchApplierFactory.php 859 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Setup\Patch;
  7. use Magento\Framework\ObjectManagerInterface;
  8. /**
  9. * This factory allows to create data patches applier
  10. */
  11. class PatchApplierFactory
  12. {
  13. /**
  14. * @var ObjectManagerInterface
  15. */
  16. private $objectManager;
  17. /**
  18. * @param ObjectManagerInterface $objectManager
  19. */
  20. public function __construct(ObjectManagerInterface $objectManager)
  21. {
  22. $this->objectManager = $objectManager;
  23. }
  24. /**
  25. * Create new instance of patch applier
  26. *
  27. * @param array $arguments
  28. * @return PatchInterface
  29. */
  30. public function create($arguments = [])
  31. {
  32. return $this->objectManager->create(\Magento\Framework\Setup\Patch\PatchApplier::class, $arguments);
  33. }
  34. }