Copy.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\App\View\Asset\MaterializationStrategy;
  7. use Magento\Framework\Filesystem\Directory\WriteInterface;
  8. use Magento\Framework\View\Asset;
  9. class Copy implements StrategyInterface
  10. {
  11. /**
  12. * Publish file
  13. *
  14. * @param WriteInterface $sourceDir
  15. * @param WriteInterface $targetDir
  16. * @param string $sourcePath
  17. * @param string $destinationPath
  18. * @return bool
  19. */
  20. public function publishFile(
  21. WriteInterface $sourceDir,
  22. WriteInterface $targetDir,
  23. $sourcePath,
  24. $destinationPath
  25. ) {
  26. return $sourceDir->copyFile($sourcePath, $destinationPath, $targetDir);
  27. }
  28. /**
  29. * Whether the strategy can be applied
  30. *
  31. * @param Asset\LocalInterface $asset
  32. * @return bool
  33. *
  34. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  35. */
  36. public function isSupported(Asset\LocalInterface $asset)
  37. {
  38. return true;
  39. }
  40. }