ModuleService.php 756 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Service\V1;
  7. /**
  8. * Module service.
  9. */
  10. class ModuleService implements ModuleServiceInterface
  11. {
  12. /**
  13. * @var \Magento\Framework\Module\ModuleListInterface
  14. */
  15. protected $moduleList;
  16. /**
  17. * @param \Magento\Framework\Module\ModuleListInterface $moduleList
  18. */
  19. public function __construct(
  20. \Magento\Framework\Module\ModuleListInterface $moduleList
  21. ) {
  22. $this->moduleList = $moduleList;
  23. }
  24. /**
  25. * Returns an array of enabled modules
  26. *
  27. * @return string[]
  28. */
  29. public function getModules()
  30. {
  31. return $this->moduleList->getNames();
  32. }
  33. }