JShrink.php 703 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Code\Minifier\Adapter\Js;
  7. use JShrink\Minifier;
  8. use Magento\Framework\Code\Minifier\AdapterInterface;
  9. /**
  10. * Adapter for JShrink library
  11. */
  12. class JShrink implements AdapterInterface
  13. {
  14. /**
  15. * Takes a string containing javascript and removes unneeded characters in
  16. * order to shrink the code without altering it's functionality.
  17. *
  18. * @param string $content The raw javascript to be minified
  19. * @throws \Exception
  20. * @return bool|string
  21. */
  22. public function minify($content)
  23. {
  24. return Minifier::minify($content);
  25. }
  26. }