functions.php 779 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Create value-object \Magento\Framework\Phrase
  8. * @deprecated The global function __() is now loaded via Magento Framework, the below require is only
  9. * for backwards compatibility reasons and this file will be removed in a future version
  10. * @see Magento\Framework\Phrase\__.php
  11. * @SuppressWarnings(PHPMD.ShortMethodName)
  12. * @return \Magento\Framework\Phrase
  13. */
  14. if (!function_exists('__')) {
  15. function __()
  16. {
  17. $argc = func_get_args();
  18. $text = array_shift($argc);
  19. if (!empty($argc) && is_array($argc[0])) {
  20. $argc = $argc[0];
  21. }
  22. return new \Magento\Framework\Phrase($text, $argc);
  23. }
  24. }