DefaultPath.php 680 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Application default url
  4. *
  5. * Copyright © Magento, Inc. All rights reserved.
  6. * See COPYING.txt for license details.
  7. */
  8. namespace Magento\Framework\App\DefaultPath;
  9. class DefaultPath implements \Magento\Framework\App\DefaultPathInterface
  10. {
  11. /**
  12. * Default path parts
  13. *
  14. * @var array
  15. */
  16. protected $_parts;
  17. /**
  18. * @param array $parts
  19. */
  20. public function __construct(array $parts)
  21. {
  22. $this->_parts = $parts;
  23. }
  24. /**
  25. * Retrieve path part by key
  26. *
  27. * @param string $code
  28. * @return string
  29. */
  30. public function getPart($code)
  31. {
  32. return $this->_parts[$code] ?? null;
  33. }
  34. }