diff --git a/app/code/Magento/Backend/App/Config.php b/app/code/Magento/Backend/App/Config.php index d8eaa7af14254bd16dd3c8f7ae3cc9a549e75cde..0ac5211b41d9f58308d4f57977e0c8054c15e4c7 100644 --- a/app/code/Magento/Backend/App/Config.php +++ b/app/code/Magento/Backend/App/Config.php @@ -10,6 +10,8 @@ namespace Magento\Backend\App; +use Magento\Framework\App\Config\ScopeConfigInterface; + /** * Backend config accessor */ @@ -36,7 +38,7 @@ class Config implements ConfigInterface */ public function getValue($path) { - return $this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path); + return $this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->getValue($path); } /** @@ -48,7 +50,7 @@ class Config implements ConfigInterface */ public function setValue($path, $value) { - $this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->setValue($path, $value); + $this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->setValue($path, $value); } /** @@ -59,6 +61,6 @@ class Config implements ConfigInterface */ public function isSetFlag($path) { - return !!$this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, null)->getValue($path); + return !!$this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null)->getValue($path); } } diff --git a/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php b/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php index d32e99a00d814b5a134e9e3060526e7586f9043e..827ae18b0b8e1f908653597bc1816a6c73d9b148 100644 --- a/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php +++ b/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php @@ -8,6 +8,8 @@ namespace Magento\Backend\Block\Page\System\Config\Robots; +use Magento\Framework\App\Config\ScopeConfigInterface; + /** * "Reset to Defaults" button renderer * @@ -50,7 +52,7 @@ class Reset extends \Magento\Config\Block\System\Config\Form\Field public function getRobotsDefaultCustomInstructions() { return trim((string)$this->_scopeConfig->getValue( - self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, ScopeConfigInterface::SCOPE_TYPE_DEFAULT )); } diff --git a/app/code/Magento/Backend/Model/Locale/Manager.php b/app/code/Magento/Backend/Model/Locale/Manager.php index 76a327f1364d1b42a05f3ea000474049d5b87068..4f9584c96a81706b0eaefafd3137a27d75291fc3 100644 --- a/app/code/Magento/Backend/Model/Locale/Manager.php +++ b/app/code/Magento/Backend/Model/Locale/Manager.php @@ -68,7 +68,7 @@ class Manager */ public function getUserInterfaceLocale() { - $interfaceLocale = \Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE; + $interfaceLocale = \Magento\Framework\Locale\Resolver::DEFAULT_LOCALE; $userData = $this->_authSession->getUser(); if ($userData && $userData->getInterfaceLocale()) { diff --git a/app/code/Magento/Backend/Test/Unit/Model/Locale/ManagerTest.php b/app/code/Magento/Backend/Test/Unit/Model/Locale/ManagerTest.php index 000c861f11d8eba4c098f8427df867287de61c2d..a624a526d5dbffd7dcd06460a11872fb1f4328c2 100644 --- a/app/code/Magento/Backend/Test/Unit/Model/Locale/ManagerTest.php +++ b/app/code/Magento/Backend/Test/Unit/Model/Locale/ManagerTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Backend\Test\Unit\Model\Locale; +use Magento\Framework\Locale\Resolver; + class ManagerTest extends \PHPUnit_Framework_TestCase { /** @@ -87,7 +89,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase { $locale = $this->_model->getUserInterfaceLocale(); - $this->assertEquals($locale, \Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE); + $this->assertEquals($locale, Resolver::DEFAULT_LOCALE); } /** diff --git a/app/code/Magento/Config/Model/Config/Backend/File.php b/app/code/Magento/Config/Model/Config/Backend/File.php index e7a119f79af9f0bf78d8f459ff0d30875abd097b..a08ed7d4f23894640e6592728f9a2c6a8eb1432b 100644 --- a/app/code/Magento/Config/Model/Config/Backend/File.php +++ b/app/code/Magento/Config/Model/Config/Backend/File.php @@ -5,6 +5,7 @@ */ namespace Magento\Config\Model\Config\Backend; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\Filesystem; @@ -196,7 +197,7 @@ class File extends \Magento\Framework\App\Config\Value protected function _prependScopeInfo($path) { $scopeInfo = $this->getScope(); - if (\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT != $this->getScope()) { + if (ScopeConfigInterface::SCOPE_TYPE_DEFAULT != $this->getScope()) { $scopeInfo .= '/' . $this->getScopeId(); } return $scopeInfo . '/' . $path; @@ -213,7 +214,7 @@ class File extends \Magento\Framework\App\Config\Value protected function _appendScopeInfo($path) { $path .= '/' . $this->getScope(); - if (\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT != $this->getScope()) { + if (ScopeConfigInterface::SCOPE_TYPE_DEFAULT != $this->getScope()) { $path .= '/' . $this->getScopeId(); } return $path; diff --git a/app/code/Magento/Config/Model/Config/Backend/Locale.php b/app/code/Magento/Config/Model/Config/Backend/Locale.php index 0881afdebfc3839d52d0c27de0052ae6a8bd68b1..3d057fd6df864d23061ba4d1d762e265482eb595 100644 --- a/app/code/Magento/Config/Model/Config/Backend/Locale.php +++ b/app/code/Magento/Config/Model/Config/Backend/Locale.php @@ -9,6 +9,8 @@ */ namespace Magento\Config\Model\Config\Backend; +use Magento\Framework\App\Config\ScopeConfigInterface; + class Locale extends \Magento\Framework\App\Config\Value { /** @@ -91,7 +93,7 @@ class Locale extends \Magento\Framework\App\Config\Value } switch ($data->getScope()) { - case \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT: + case ScopeConfigInterface::SCOPE_TYPE_DEFAULT: $scopeName = __('Default scope'); break; diff --git a/app/code/Magento/Config/Model/Config/ScopeDefiner.php b/app/code/Magento/Config/Model/Config/ScopeDefiner.php index 893496d874009b9834fc2f1821057283ba01e323..f2230e2737e05b4f2707103e5fca4a8c4fe9cf73 100644 --- a/app/code/Magento/Config/Model/Config/ScopeDefiner.php +++ b/app/code/Magento/Config/Model/Config/ScopeDefiner.php @@ -5,6 +5,7 @@ */ namespace Magento\Config\Model\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\ScopeInterface as StoreScopeInterface; /** @@ -38,6 +39,6 @@ class ScopeDefiner 'store' ) ? StoreScopeInterface::SCOPE_STORE : ($this->_request->getParam( 'website' - ) ? StoreScopeInterface::SCOPE_WEBSITE : \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); + ) ? StoreScopeInterface::SCOPE_WEBSITE : StoreScopeInterface::SCOPE_DEFAULT); } } diff --git a/app/code/Magento/Config/Model/Config/Structure/AbstractElement.php b/app/code/Magento/Config/Model/Config/Structure/AbstractElement.php index e10a1a1c3e725333743bea341d6170865f17d119..03ed66f29abec3ebd79735f648aefcd633dc44cc 100644 --- a/app/code/Magento/Config/Model/Config/Structure/AbstractElement.php +++ b/app/code/Magento/Config/Model/Config/Structure/AbstractElement.php @@ -5,6 +5,7 @@ */ namespace Magento\Config\Model\Config\Structure; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\StoreManagerInterface; abstract class AbstractElement implements ElementInterface @@ -136,7 +137,7 @@ abstract class AbstractElement implements ElementInterface $showInScope = [ \Magento\Store\Model\ScopeInterface::SCOPE_STORE => $this->_hasVisibilityValue('showInStore'), \Magento\Store\Model\ScopeInterface::SCOPE_WEBSITE => $this->_hasVisibilityValue('showInWebsite'), - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT => $this->_hasVisibilityValue('showInDefault'), + ScopeConfigInterface::SCOPE_TYPE_DEFAULT => $this->_hasVisibilityValue('showInDefault'), ]; if ($this->_storeManager->isSingleStoreMode()) { diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/ScopeDefinerTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/ScopeDefinerTest.php index 23069beec258fa8c6ab4e398c537a4874a9010b7..e0c64a35053ad44c88baa18861e84641a995d17d 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/ScopeDefinerTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/ScopeDefinerTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Config\Test\Unit\Model\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class ScopeDefinerTest extends \PHPUnit_Framework_TestCase @@ -31,7 +32,7 @@ class ScopeDefinerTest extends \PHPUnit_Framework_TestCase public function testGetScopeReturnsDefaultScopeIfNoScopeDataIsSpecified() { - $this->assertEquals(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $this->_model->getScope()); + $this->assertEquals(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $this->_model->getScope()); } public function testGetScopeReturnsStoreScopeIfStoreIsSpecified() diff --git a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php index 03e9fd8d2266e5c9256c74a81716e59e4eb40ac0..778141ab2132096aa8d0e750f7175bebdcea935b 100644 --- a/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php +++ b/app/code/Magento/Config/Test/Unit/Model/Config/Structure/AbstractElementTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Config\Test\Unit\Model\Config\Structure; +use Magento\Framework\App\Config\ScopeConfigInterface; + class AbstractElementTest extends \PHPUnit_Framework_TestCase { /** @@ -77,7 +79,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase $this->_storeManager->expects($this->once())->method('isSingleStoreMode')->will($this->returnValue(true)); $this->_model->setData( ['showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 0], - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); $this->assertTrue($this->_model->isVisible()); } @@ -87,7 +89,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase $this->_storeManager->expects($this->once())->method('isSingleStoreMode')->will($this->returnValue(true)); $this->_model->setData( ['hide_in_single_store_mode' => 1, 'showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 0], - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); $this->assertFalse($this->_model->isVisible()); } @@ -100,7 +102,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase $this->_storeManager->expects($this->once())->method('isSingleStoreMode')->will($this->returnValue(true)); $this->_model->setData( ['showInDefault' => 0, 'showInStore' => 0, 'showInWebsite' => 0], - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); $this->assertFalse($this->_model->isVisible()); } @@ -121,7 +123,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase return [ [ ['showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 0], - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + ScopeConfigInterface::SCOPE_TYPE_DEFAULT, ], [ ['showInDefault' => 0, 'showInStore' => 1, 'showInWebsite' => 0], @@ -150,7 +152,7 @@ class AbstractElementTest extends \PHPUnit_Framework_TestCase return [ [ ['showInDefault' => 0, 'showInStore' => 1, 'showInWebsite' => 1], - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + ScopeConfigInterface::SCOPE_TYPE_DEFAULT, ], [ ['showInDefault' => 1, 'showInStore' => 0, 'showInWebsite' => 1], diff --git a/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php b/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php index 7e187a71e5c08bdad11cf84b9cfdc3c9ca85632c..b25f4c6d0b3a3cb83b3693f1d2d7c08fb4859247 100644 --- a/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php +++ b/app/code/Magento/Customer/Model/Config/Backend/Address/Street.php @@ -5,6 +5,8 @@ */ namespace Magento\Customer\Model\Config\Backend\Address; +use Magento\Framework\App\Config\ScopeConfigInterface; + /** * Line count config model for customer address street attribute * @@ -64,7 +66,7 @@ class Street extends \Magento\Framework\App\Config\Value } break; - case \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT: + case ScopeConfigInterface::SCOPE_TYPE_DEFAULT: $attribute->setData('multiline_count', $value); break; } diff --git a/app/code/Magento/Customer/Model/Customer.php b/app/code/Magento/Customer/Model/Customer.php index d6792e7d47c2a33d77b8b6991754a7dad31c3e56..ddc07a2e1e90f96b427b0268bf36b403a317504a 100644 --- a/app/code/Magento/Customer/Model/Customer.php +++ b/app/code/Magento/Customer/Model/Customer.php @@ -12,6 +12,7 @@ use Magento\Customer\Model\Resource\Address\CollectionFactory; use Magento\Customer\Model\Resource\Customer as ResourceCustomer; use Magento\Customer\Api\Data\CustomerInterfaceFactory; use Magento\Customer\Model\Data\Customer as CustomerData; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Reflection\DataObjectProcessor; use Magento\Framework\Exception\EmailNotConfirmedException; use Magento\Framework\Exception\InvalidEmailOrPasswordException; @@ -1304,7 +1305,7 @@ class Customer extends \Magento\Framework\Model\AbstractModel { return (int)$this->_scopeConfig->getValue( self::XML_PATH_CUSTOMER_RESET_PASSWORD_LINK_EXPIRATION_PERIOD, - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); } diff --git a/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php b/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php index 5d1e91708b4fcd6da306011c551415bf3586d66a..834c64df6701f19605ccd05fb8298d1def87fa4a 100644 --- a/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php +++ b/app/code/Magento/Customer/Test/Unit/Block/Widget/DobTest.php @@ -10,6 +10,7 @@ namespace Magento\Customer\Test\Unit\Block\Widget; use Magento\Framework\Exception\NoSuchEntityException; use Magento\Customer\Block\Widget\Dob; +use Magento\Framework\Locale\Resolver; class DobTest extends \PHPUnit_Framework_TestCase { @@ -69,7 +70,7 @@ class DobTest extends \PHPUnit_Framework_TestCase $localeResolver = $this->getMock('\Magento\Framework\Locale\ResolverInterface'); $localeResolver->expects($this->any()) ->method('getLocale') - ->willReturn(\Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE); + ->willReturn(Resolver::DEFAULT_LOCALE); $timezone = $objectManager->getObject( 'Magento\Framework\Stdlib\DateTime\Timezone', ['localeResolver' => $localeResolver] diff --git a/app/code/Magento/Email/Model/BackendTemplate.php b/app/code/Magento/Email/Model/BackendTemplate.php index be5b232564a67e139724e96f6d7a51a89702ed9c..6584fdbd21575e6ad0d5e429bee7bd97b7d197cc 100644 --- a/app/code/Magento/Email/Model/BackendTemplate.php +++ b/app/code/Magento/Email/Model/BackendTemplate.php @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ namespace Magento\Email\Model; +use Magento\Framework\App\Config\ScopeConfigInterface; /** * Adminhtml email template model @@ -78,7 +79,7 @@ class BackendTemplate extends Template return []; } - $configData = $this->_scopeConfig->getValue(null, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); + $configData = $this->_scopeConfig->getValue(null, ScopeConfigInterface::SCOPE_TYPE_DEFAULT); $paths = $this->_findEmailTemplateUsages($templateCode, $configData, ''); return $paths; } diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/EditInterface.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/EditInterface.php deleted file mode 100644 index 79fefe2a18515d4f143f561aba1c9a2f9e3f4cde..0000000000000000000000000000000000000000 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/EditInterface.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -/** - * - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -namespace Magento\Sales\Controller\Adminhtml\Order; - -interface EditInterface extends \Magento\Framework\App\ActionInterface -{ -} diff --git a/app/code/Magento/Store/Model/Config/Reader/DefaultReader.php b/app/code/Magento/Store/Model/Config/Reader/DefaultReader.php index 4f03885e8cd7a910cb35abf05970bd86deb5a790..911e9bd8ae155e59d0e741d9ba3e4f4863f95b17 100644 --- a/app/code/Magento/Store/Model/Config/Reader/DefaultReader.php +++ b/app/code/Magento/Store/Model/Config/Reader/DefaultReader.php @@ -7,6 +7,8 @@ */ namespace Magento\Store\Model\Config\Reader; +use Magento\Framework\App\Config\ScopeConfigInterface; + class DefaultReader implements \Magento\Framework\App\Config\Scope\ReaderInterface { /** @@ -42,14 +44,21 @@ class DefaultReader implements \Magento\Framework\App\Config\Scope\ReaderInterfa /** * Read configuration data * + * @param null|string $scope + * @throws \Magento\Framework\Exception Exception is thrown when scope other than default is given * @return array */ - public function read() + public function read($scope = null) { - $config = $this->_initialConfig->getData(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); + $scope = $scope === null ? ScopeConfigInterface::SCOPE_TYPE_DEFAULT : $scope; + if ($scope !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT) { + throw new \Magento\Framework\Exception("Only default scope allowed"); + } + + $config = $this->_initialConfig->getData($scope); $collection = $this->_collectionFactory->create( - ['scope' => \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT] + ['scope' => $scope] ); $dbDefaultConfig = []; foreach ($collection as $item) { diff --git a/app/code/Magento/Store/Model/Config/Reader/Store.php b/app/code/Magento/Store/Model/Config/Reader/Store.php index c5456bcb102f9ad2952c17f33ac41f48c1ae777a..151c3625f2b1dbf596d222eaf10b3f7c9e07ce5e 100644 --- a/app/code/Magento/Store/Model/Config/Reader/Store.php +++ b/app/code/Magento/Store/Model/Config/Reader/Store.php @@ -5,6 +5,7 @@ */ namespace Magento\Store\Model\Config\Reader; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Exception\NoSuchEntityException; class Store implements \Magento\Framework\App\Config\Scope\ReaderInterface @@ -66,7 +67,7 @@ class Store implements \Magento\Framework\App\Config\Scope\ReaderInterface /** * Read configuration by code * - * @param string $code + * @param null|string $code * @return array * @throws NoSuchEntityException */ @@ -74,7 +75,7 @@ class Store implements \Magento\Framework\App\Config\Scope\ReaderInterface { if (empty($code)) { $store = $this->_storeManager->getStore(); - } elseif (($code == \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT)) { + } elseif (($code == ScopeConfigInterface::SCOPE_TYPE_DEFAULT)) { $store = $this->_storeManager->getDefaultStoreView(); } else { $store = $this->_storeFactory->create(); diff --git a/app/code/Magento/Store/Model/Config/Reader/Website.php b/app/code/Magento/Store/Model/Config/Reader/Website.php index 1448b04bf9afbf5e6b49b5e223f53b9ec2a52f69..7971deb6c9713199cfe7c85617ebe767556edb18 100644 --- a/app/code/Magento/Store/Model/Config/Reader/Website.php +++ b/app/code/Magento/Store/Model/Config/Reader/Website.php @@ -5,6 +5,8 @@ */ namespace Magento\Store\Model\Config\Reader; +use Magento\Framework\App\Config\ScopeConfigInterface; + class Website implements \Magento\Framework\App\Config\Scope\ReaderInterface { /** @@ -62,7 +64,7 @@ class Website implements \Magento\Framework\App\Config\Scope\ReaderInterface public function read($code = null) { $config = array_replace_recursive( - $this->_scopePool->getScope(\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT)->getSource(), + $this->_scopePool->getScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT)->getSource(), $this->_initialConfig->getData("websites|{$code}") ); diff --git a/app/code/Magento/Store/Model/Store.php b/app/code/Magento/Store/Model/Store.php index 7dbf046110e38000509cbd55318a57efbc1b80f0..46652a6aac51bda9b6e5efa12c2420b176413810 100644 --- a/app/code/Magento/Store/Model/Store.php +++ b/app/code/Magento/Store/Model/Store.php @@ -5,6 +5,7 @@ */ namespace Magento\Store\Model; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\Filesystem\DirectoryList; use Magento\Framework\App\Http\Context; use Magento\Framework\Model\AbstractModel; @@ -55,7 +56,7 @@ class Store extends AbstractModel implements const XML_PATH_UNSECURE_BASE_URL = 'web/unsecure/base_url'; const XML_PATH_SECURE_BASE_URL = 'web/secure/base_url'; - + const XML_PATH_SECURE_IN_FRONTEND = 'web/secure/use_in_frontend'; const XML_PATH_SECURE_IN_ADMINHTML = 'web/secure/use_in_adminhtml'; @@ -479,7 +480,7 @@ class Store extends AbstractModel implements { $data = $this->_config->getValue($path, ScopeInterface::SCOPE_STORE, $this->getCode()); if (!$data) { - $data = $this->_config->getValue($path, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); + $data = $this->_config->getValue($path, ScopeConfigInterface::SCOPE_TYPE_DEFAULT); } return $data === false ? null : $data; } @@ -783,7 +784,7 @@ class Store extends AbstractModel implements if ($configValue == self::PRICE_SCOPE_GLOBAL) { return $this->_config->getValue( \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE, - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); } else { return $this->_getConfig(\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE); diff --git a/app/code/Magento/Store/Test/Unit/Model/Config/Reader/DefaultReaderTest.php b/app/code/Magento/Store/Test/Unit/Model/Config/Reader/DefaultReaderTest.php index 9e91f4b43281522ac0a2d3688167488893df43e3..25875ae67dd5973525a0a59cbf7e2c1635c58691 100644 --- a/app/code/Magento/Store/Test/Unit/Model/Config/Reader/DefaultReaderTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/Config/Reader/DefaultReaderTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Store\Test\Unit\Model\Config\Reader; +use Magento\Framework\App\Config\ScopeConfigInterface; + class DefaultReaderTest extends \PHPUnit_Framework_TestCase { /** @@ -46,7 +48,7 @@ class DefaultReaderTest extends \PHPUnit_Framework_TestCase )->method( 'getData' )->with( - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT )->will( $this->returnValue(['config' => ['key1' => 'default_value1', 'key2' => 'default_value2']]) ); diff --git a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php index c43af1f004dfe6972d9521e3d49bd6474fb99a4b..cfb2001ddd28c8f659957cc0350251ebb7753c74 100644 --- a/app/code/Magento/Store/Test/Unit/Model/StoreTest.php +++ b/app/code/Magento/Store/Test/Unit/Model/StoreTest.php @@ -8,6 +8,7 @@ namespace Magento\Store\Test\Unit\Model; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Store\Model\ScopeInterface; use Magento\Framework\App\Config\ReinitableConfigInterface; use Magento\Store\Model\Store; @@ -399,7 +400,7 @@ class StoreTest extends \PHPUnit_Framework_TestCase ['catalog/price/scope', ScopeInterface::SCOPE_STORE, 'scope_code', $priceScope], [ \Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE, - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null, 'USD' ], diff --git a/app/code/Magento/Tax/Controller/Adminhtml/Tax/IgnoreTaxNotification.php b/app/code/Magento/Tax/Controller/Adminhtml/Tax/IgnoreTaxNotification.php index d84a09825b08fb4391830a6ec8261b24d152557a..a31e0019851664fa6c4cf1ab7dd46b3c58fc2e03 100644 --- a/app/code/Magento/Tax/Controller/Adminhtml/Tax/IgnoreTaxNotification.php +++ b/app/code/Magento/Tax/Controller/Adminhtml/Tax/IgnoreTaxNotification.php @@ -7,6 +7,7 @@ namespace Magento\Tax\Controller\Adminhtml\Tax; use Magento\Framework\Controller\ResultFactory; +use Magento\Framework\App\Config\ScopeConfigInterface; class IgnoreTaxNotification extends \Magento\Tax\Controller\Adminhtml\Tax { @@ -43,7 +44,7 @@ class IgnoreTaxNotification extends \Magento\Tax\Controller\Adminhtml\Tax try { $path = 'tax/notification/ignore_' . $section; $this->_objectManager->get('Magento\Config\Model\Resource\Config') - ->saveConfig($path, 1, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, 0); + ->saveConfig($path, 1, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0); } catch (\Exception $e) { $this->messageManager->addError($e->getMessage()); } diff --git a/app/code/Magento/Tax/Model/Config/Notification.php b/app/code/Magento/Tax/Model/Config/Notification.php index c886452442406056cb369dd15210a1c32b0c9829..f4b395a290856cf26c36fae743ac7a3ce9797c9b 100644 --- a/app/code/Magento/Tax/Model/Config/Notification.php +++ b/app/code/Magento/Tax/Model/Config/Notification.php @@ -5,6 +5,8 @@ */ namespace Magento\Tax\Model\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; + /** * Tax Config Notification */ @@ -59,7 +61,7 @@ class Notification extends \Magento\Framework\App\Config\Value */ protected function _resetNotificationFlag($path) { - $this->resourceConfig->saveConfig($path, 0, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, 0); + $this->resourceConfig->saveConfig($path, 0, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0); return $this; } } diff --git a/app/code/Magento/Tax/Test/Unit/Controller/Adminhtml/Tax/IgnoreTaxNotificationTest.php b/app/code/Magento/Tax/Test/Unit/Controller/Adminhtml/Tax/IgnoreTaxNotificationTest.php index 2f2a823d5f64d3cb8c3b00a4c864a7108e181c32..8714905efc56bc118efd516eb8346ec1e2045ad6 100644 --- a/app/code/Magento/Tax/Test/Unit/Controller/Adminhtml/Tax/IgnoreTaxNotificationTest.php +++ b/app/code/Magento/Tax/Test/Unit/Controller/Adminhtml/Tax/IgnoreTaxNotificationTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Tax\Test\Unit\Controller\Adminhtml\Tax; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; class IgnoreTaxNotificationTest extends \PHPUnit_Framework_TestCase @@ -51,7 +52,7 @@ class IgnoreTaxNotificationTest extends \PHPUnit_Framework_TestCase ->getMock(); $config->expects($this->once()) ->method('saveConfig') - ->with('tax/notification/ignore_tax', 1, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, 0) + ->with('tax/notification/ignore_tax', 1, ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0) ->willReturn(null); $manager = $this->getMockBuilder('\Magento\Framework\ObjectManagerInterface') diff --git a/app/code/Magento/Theme/Model/Config.php b/app/code/Magento/Theme/Model/Config.php index 5993e9bf010d5586384e03bdc4df50010f882547..39332cc9a0b7b7705db033cb7996e0fd3c482e90 100644 --- a/app/code/Magento/Theme/Model/Config.php +++ b/app/code/Magento/Theme/Model/Config.php @@ -9,6 +9,8 @@ */ namespace Magento\Theme\Model; +use Magento\Framework\App\Config\ScopeConfigInterface; + class Config { /** @@ -173,7 +175,7 @@ class Config protected function _assignThemeToDefaultScope($themeId, &$isReassigned) { $configPath = \Magento\Framework\View\DesignInterface::XML_PATH_THEME_ID; - $this->_configWriter->save($configPath, $themeId, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT); + $this->_configWriter->save($configPath, $themeId, ScopeConfigInterface::SCOPE_TYPE_DEFAULT); $isReassigned = true; return $this; } diff --git a/app/code/Magento/Theme/Model/View/Design.php b/app/code/Magento/Theme/Model/View/Design.php index f839d6ba900f71e2998634aa9e36776bcd863105..a158874feff56bbf6d696c7a385d607cc4acb17b 100644 --- a/app/code/Magento/Theme/Model/View/Design.php +++ b/app/code/Magento/Theme/Model/View/Design.php @@ -5,6 +5,7 @@ */ namespace Magento\Theme\Model\View; +use Magento\Framework\App\Config\ScopeConfigInterface; /** * Keeps design settings for current request @@ -167,7 +168,7 @@ class Design implements \Magento\Framework\View\DesignInterface if ($this->_storeManager->isSingleStoreMode()) { $theme = $this->_scopeConfig->getValue( self::XML_PATH_THEME_ID, - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); } else { $theme = (string) $this->_scopeConfig->getValue( diff --git a/app/code/Magento/User/Controller/Adminhtml/User/Edit.php b/app/code/Magento/User/Controller/Adminhtml/User/Edit.php index 3d3ad64cd201a0bf5cc7eb3691852ab451317e21..39ac43d55391ba02f47089b28233a7f13e791d86 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User/Edit.php +++ b/app/code/Magento/User/Controller/Adminhtml/User/Edit.php @@ -6,6 +6,8 @@ */ namespace Magento\User\Controller\Adminhtml\User; +use Magento\Framework\Locale\Resolver; + class Edit extends \Magento\User\Controller\Adminhtml\User { /** @@ -25,7 +27,7 @@ class Edit extends \Magento\User\Controller\Adminhtml\User return; } } else { - $model->setInterfaceLocale(\Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE); + $model->setInterfaceLocale(Resolver::DEFAULT_LOCALE); } // Restore previously entered form data from session diff --git a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php index 9854602a507fcc0045fcc2f5be86a85f96073b0d..3809d7f293849488c696e4631c03e6ed34e0de02 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Annotation/ConfigFixture.php @@ -9,6 +9,8 @@ */ namespace Magento\TestFramework\Annotation; +use Magento\Framework\App\Config\ScopeConfigInterface; + class ConfigFixture { /** @@ -73,7 +75,7 @@ class ConfigFixture )->setValue( $configPath, $value, - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT ); } } else { diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/Locale/ResolverTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/Locale/ResolverTest.php index 09c21758cba336cbd15982d610875cbc0aa19117..c0cc101fd36bfe94dd5dcc19481d81d14b926132 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/Locale/ResolverTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/Locale/ResolverTest.php @@ -5,6 +5,8 @@ */ namespace Magento\Backend\Model\Locale; +use Magento\Framework\Locale\Resolver; + /** * @magentoAppArea adminhtml */ @@ -28,7 +30,7 @@ class ResolverTest extends \PHPUnit_Framework_TestCase */ public function testSetLocaleWithDefaultLocale() { - $this->_checkSetLocale(\Magento\Framework\Locale\ResolverInterface::DEFAULT_LOCALE); + $this->_checkSetLocale(Resolver::DEFAULT_LOCALE); } /** diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/ObserverTest.php index 14f306766a10720ac021fc9ce9b94ecff8ee08cd..fd30d5b492fc7e9af0e9eaf12efa47e88bc03cf6 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/ObserverTest.php @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ namespace Magento\Payment\Model; +use Magento\Framework\App\Config\ScopeConfigInterface; /** * @magentoAppArea adminhtml @@ -68,7 +69,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $config->saveConfig( 'payment/checkmo/order_status', $statusCode, - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0 ); diff --git a/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SetupUtil.php b/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SetupUtil.php index 861079efbac7df145af34557037fa6b79bb886e0..331bfebab31ad4078259e912e982010cb44302e6 100644 --- a/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SetupUtil.php +++ b/dev/tests/integration/testsuite/Magento/Tax/Model/Sales/Total/Quote/SetupUtil.php @@ -8,6 +8,7 @@ namespace Magento\Tax\Model\Sales\Total\Quote; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Tax\Model\Config; use Magento\Tax\Model\Calculation; @@ -221,7 +222,7 @@ class SetupUtil $config->saveConfig( $path, $value, - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0 ); } diff --git a/dev/tests/performance/testsuite/fixtures/catalog_category_flat_enabled.php b/dev/tests/performance/testsuite/fixtures/catalog_category_flat_enabled.php index 00cd8ce5cb1d148ff81ebcad4ad463fd1933df2f..056fe99b815516c7bb1b20181297a78013312268 100644 --- a/dev/tests/performance/testsuite/fixtures/catalog_category_flat_enabled.php +++ b/dev/tests/performance/testsuite/fixtures/catalog_category_flat_enabled.php @@ -3,6 +3,7 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ +use Magento\Framework\App\Config\ScopeConfigInterface; /** @var \Magento\TestFramework\Application $this */ @@ -13,7 +14,7 @@ $configData = $this->getObjectManager()->create('Magento\Framework\App\Config\Va $configData->setPath( 'catalog/frontend/flat_catalog_category' )->setScope( - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT )->setScopeId( 0 )->setValue( diff --git a/dev/tests/performance/testsuite/fixtures/catalog_product_flat_enabled.php b/dev/tests/performance/testsuite/fixtures/catalog_product_flat_enabled.php index 2258e72023d4ad642e1e799134e8b32cbb94d1ab..e06ed0e26c053f2742d6a132f17b4a0f4b8558ce 100644 --- a/dev/tests/performance/testsuite/fixtures/catalog_product_flat_enabled.php +++ b/dev/tests/performance/testsuite/fixtures/catalog_product_flat_enabled.php @@ -3,6 +3,7 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ +use Magento\Framework\App\Config\ScopeConfigInterface; /** @var \Magento\TestFramework\Application $this */ @@ -13,7 +14,7 @@ $configData = $this->getObjectManager()->create('Magento\Framework\App\Config\Va $configData->setPath( 'catalog/frontend/flat_catalog_product' )->setScope( - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT )->setScopeId( 0 )->setValue( diff --git a/dev/tests/performance/testsuite/fixtures/shipping_flatrate_enabled.php b/dev/tests/performance/testsuite/fixtures/shipping_flatrate_enabled.php index e0f50505c4adcf397a358a5d8d31e336bd00a3e6..15b445ce1f8b5ca75cf4b6eb1ae20a179bcfa356 100644 --- a/dev/tests/performance/testsuite/fixtures/shipping_flatrate_enabled.php +++ b/dev/tests/performance/testsuite/fixtures/shipping_flatrate_enabled.php @@ -3,6 +3,7 @@ * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ +use Magento\Framework\App\Config\ScopeConfigInterface; /** @var \Magento\TestFramework\Application $this */ @@ -13,7 +14,7 @@ $configData = $this->getObjectManager()->create('Magento\Framework\App\Config\Va $configData->setPath( 'carriers/flatrate/active' )->setScope( - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT )->setScopeId( 0 )->setValue( diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php index a3fa40a7f43a6718bc2949067c23dd314b874c11..b0e6f2627029a8da911b3e6a4358c3aff4f133af 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php @@ -702,4 +702,26 @@ return [ 'Use \Magento\Eav\Model\Entity\Type::getDefaultAttributeSetId() method instead', ], ['CONFIG_PATH_WSDL_CACHE_ENABLED', 'Magento\Webapi\Model\Soap\Server'], + ['ENTITY', 'Magento\Framework\App\Config\ValueInterface'], + ['XML_PATH_ALLOW_CURRENCIES_INSTALLED', 'Magento\Framework\Locale\CurrencyInterface'], + [ + 'DEFAULT_CURRENCY', + 'Magento\Framework\Locale\CurrencyInterface', + 'Magento\Framework\Locale\Currency::DEFAULT_CURRENCY' + ], + [ + 'DEFAULT_LOCALE', + 'Magento\Framework\Locale\ResolverInterface', + 'Magento\Framework\Locale\Resolver::DEFAULT_LOCALE' + ], + [ + 'DEFAULT_GROUP', + 'Magento\Framework\Message\ManagerInterface', + 'Magento\Framework\Message\Manager::DEFAULT_GROUP' + ], + [ + 'SCOPE_DEFAULT', + 'Magento\Framework\App\ScopeInterface', + 'Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT' + ] ]; diff --git a/lib/internal/Magento/Framework/App/Area/FrontNameResolverInterface.php b/lib/internal/Magento/Framework/App/Area/FrontNameResolverInterface.php index bbdd3787b1825ffa9c35882776a9173c03b9607a..e8a3e92263e7d9b50226911e4d445b1a663171f7 100644 --- a/lib/internal/Magento/Framework/App/Area/FrontNameResolverInterface.php +++ b/lib/internal/Magento/Framework/App/Area/FrontNameResolverInterface.php @@ -7,6 +7,10 @@ */ namespace Magento\Framework\App\Area; +/** + * Interface FrontNameResolverInterface + * @api + */ interface FrontNameResolverInterface { /** diff --git a/lib/internal/Magento/Framework/App/AreaInterface.php b/lib/internal/Magento/Framework/App/AreaInterface.php index 806a7983424599690e3b7f02443fb7e9b4b328a5..544ac56e19e6f10dd13c5a284d56dba2d6e4b010 100644 --- a/lib/internal/Magento/Framework/App/AreaInterface.php +++ b/lib/internal/Magento/Framework/App/AreaInterface.php @@ -6,6 +6,9 @@ */ namespace Magento\Framework\App; +/** + * Interface AreaInterface + */ interface AreaInterface { const PART_CONFIG = 'config'; diff --git a/lib/internal/Magento/Framework/App/AreaList.php b/lib/internal/Magento/Framework/App/AreaList.php index 270fb22e36675b08576b06500e7cd6da38f39466..c010388797d870fa25e7aec9a192edef8ed0a73b 100644 --- a/lib/internal/Magento/Framework/App/AreaList.php +++ b/lib/internal/Magento/Framework/App/AreaList.php @@ -63,6 +63,7 @@ class AreaList * * @param string $frontName * @return null|string + * @api */ public function getCodeByFrontName($frontName) { @@ -84,6 +85,7 @@ class AreaList * * @param string $areaCode * @return string + * @api */ public function getFrontName($areaCode) { @@ -94,6 +96,7 @@ class AreaList * Retrieve area codes * * @return string[] + * @api */ public function getCodes() { @@ -105,6 +108,7 @@ class AreaList * * @param string $areaCode * @return string + * @api */ public function getDefaultRouter($areaCode) { diff --git a/lib/internal/Magento/Framework/App/Config.php b/lib/internal/Magento/Framework/App/Config.php index 047849f0034bde6164c2a054c81817e2daccdd2a..898a19a00ea5f20ff98bce5a7cb5eaa322972869 100644 --- a/lib/internal/Magento/Framework/App/Config.php +++ b/lib/internal/Magento/Framework/App/Config.php @@ -7,6 +7,8 @@ */ namespace Magento\Framework\App; +use Magento\Framework\App\Config\ScopeConfigInterface; + class Config implements \Magento\Framework\App\Config\ScopeConfigInterface { /** @@ -37,7 +39,7 @@ class Config implements \Magento\Framework\App\Config\ScopeConfigInterface */ public function getValue( $path = null, - $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null ) { return $this->_scopePool->getScope($scope, $scopeCode)->getValue($path); @@ -51,7 +53,7 @@ class Config implements \Magento\Framework\App\Config\ScopeConfigInterface * @param null|string $scopeCode * @return bool */ - public function isSetFlag($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null) + public function isSetFlag($path, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null) { return (bool) $this->getValue($path, $scope, $scopeCode); } diff --git a/lib/internal/Magento/Framework/App/Config/Data.php b/lib/internal/Magento/Framework/App/Config/Data.php index 3b5f17fe71639559575a77bc431fccc7071388f0..38389e71e40aaf297d4983bdde8377db615d5493 100644 --- a/lib/internal/Magento/Framework/App/Config/Data.php +++ b/lib/internal/Magento/Framework/App/Config/Data.php @@ -42,10 +42,7 @@ class Data implements DataInterface } /** - * Retrieve configuration value by path - * - * @param null|string $path - * @return array|string + * @inheritdoc */ public function getValue($path = null) { @@ -65,11 +62,7 @@ class Data implements DataInterface } /** - * Set configuration value - * - * @param string $path - * @param mixed $value - * @return void + * @inheritdoc */ public function setValue($path, $value) { diff --git a/lib/internal/Magento/Framework/App/Config/Data/ProcessorFactory.php b/lib/internal/Magento/Framework/App/Config/Data/ProcessorFactory.php index 8f473e2a37b2ba3c9cf3a0e707dd43f9bbe70902..8084dcd5d08f45c755a9c5b0490bf1fea78f8894 100644 --- a/lib/internal/Magento/Framework/App/Config/Data/ProcessorFactory.php +++ b/lib/internal/Magento/Framework/App/Config/Data/ProcessorFactory.php @@ -30,21 +30,22 @@ class ProcessorFactory /** * Get concrete Processor Interface instance * - * @param string $model + * @param string $processorModel Classname of the instance to get * @return ProcessorInterface - * @throws \InvalidArgumentException + * @throws \InvalidArgumentException In case the given classname is not an instance of ProcessorInterface + * @api */ - public function get($model) + public function get($processorModel) { - if (!isset($this->_pool[$model])) { - $instance = $this->_objectManager->create($model); + if (!isset($this->_pool[$processorModel])) { + $instance = $this->_objectManager->create($processorModel); if (!$instance instanceof ProcessorInterface) { throw new \InvalidArgumentException( - $model . ' is not instance of \Magento\Framework\App\Config\Data\ProcessorInterface' + $processorModel . ' is not instance of \Magento\Framework\App\Config\Data\ProcessorInterface' ); } - $this->_pool[$model] = $instance; + $this->_pool[$processorModel] = $instance; } - return $this->_pool[$model]; + return $this->_pool[$processorModel]; } } diff --git a/lib/internal/Magento/Framework/App/Config/Data/ProcessorInterface.php b/lib/internal/Magento/Framework/App/Config/Data/ProcessorInterface.php index 71102131f42cf4071b6d213d225ac8178956945a..d4467339676739d2e92250b986d992458772cc68 100644 --- a/lib/internal/Magento/Framework/App/Config/Data/ProcessorInterface.php +++ b/lib/internal/Magento/Framework/App/Config/Data/ProcessorInterface.php @@ -1,19 +1,22 @@ <?php /** - * Processor interface - * * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\App\Config\Data; +/** + * Processes data from admin store configuration fields + * + * @api + */ interface ProcessorInterface { /** * Process config value * - * @param string $value - * @return string + * @param string $value Raw value of the configuration field + * @return string Processed value */ public function processValue($value); } diff --git a/lib/internal/Magento/Framework/App/Config/DataInterface.php b/lib/internal/Magento/Framework/App/Config/DataInterface.php index bbdaf54d1c342a11803527f92160ebacef27a0a6..b07ca0e0df1fc3ce8085227057148619c371f0f9 100644 --- a/lib/internal/Magento/Framework/App/Config/DataInterface.php +++ b/lib/internal/Magento/Framework/App/Config/DataInterface.php @@ -5,11 +5,27 @@ */ namespace Magento\Framework\App\Config; +/** + * Configuration data storage + * + * @api + */ interface DataInterface { /** + * Retrieve configuration value by path + * * @param string|null $path - * @return string|array + * @return mixed */ public function getValue($path); + + /** + * Set configuration value by path + * + * @param string $path + * @param mixed $value + * @return void + */ + public function setValue($path, $value); } diff --git a/lib/internal/Magento/Framework/App/Config/Initial.php b/lib/internal/Magento/Framework/App/Config/Initial.php index 68db7b1eb84d42c669f3874b180038292a087983..3b2beb5ca37423ee054d94d2d3289bdacd21bca5 100644 --- a/lib/internal/Magento/Framework/App/Config/Initial.php +++ b/lib/internal/Magento/Framework/App/Config/Initial.php @@ -7,6 +7,8 @@ */ namespace Magento\Framework\App\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; + class Initial { /** @@ -50,14 +52,14 @@ class Initial /** * Get initial data by given scope * - * @param string $scope + * @param string $scope Format is scope type and scope code separated by pipe: e.g. "type|code" * @return array */ public function getData($scope) { list($scopeType, $scopeCode) = array_pad(explode('|', $scope), 2, null); - if (\Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT == $scopeType) { + if (ScopeConfigInterface::SCOPE_TYPE_DEFAULT == $scopeType) { return isset($this->_data[$scopeType]) ? $this->_data[$scopeType] : []; } elseif ($scopeCode) { return isset($this->_data[$scopeType][$scopeCode]) ? $this->_data[$scopeType][$scopeCode] : []; diff --git a/lib/internal/Magento/Framework/App/Config/MutableScopeConfigInterface.php b/lib/internal/Magento/Framework/App/Config/MutableScopeConfigInterface.php index 37a371b547f40439addcfad205d29dd9c178fb07..f68048ddc94611267e17df9c85eb203bf28097a2 100644 --- a/lib/internal/Magento/Framework/App/Config/MutableScopeConfigInterface.php +++ b/lib/internal/Magento/Framework/App/Config/MutableScopeConfigInterface.php @@ -8,6 +8,9 @@ namespace Magento\Framework\App\Config; +/** + * @api + */ interface MutableScopeConfigInterface extends \Magento\Framework\App\Config\ScopeConfigInterface { /** @@ -15,14 +18,14 @@ interface MutableScopeConfigInterface extends \Magento\Framework\App\Config\Scop * * @param string $path * @param mixed $value - * @param string $scope + * @param string $scopeType * @param null|string $scopeCode * @return void */ public function setValue( $path, $value, - $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + $scopeType = \Magento\Framework\App\Config\ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null ); } diff --git a/lib/internal/Magento/Framework/App/Config/ReinitableConfigInterface.php b/lib/internal/Magento/Framework/App/Config/ReinitableConfigInterface.php index 5b9d9d78eb3b4789a2ac6477e5e686ff3e4f0c6f..f9fc887a878e0ec0b73e2ad956ae0ff3b1ae166a 100644 --- a/lib/internal/Magento/Framework/App/Config/ReinitableConfigInterface.php +++ b/lib/internal/Magento/Framework/App/Config/ReinitableConfigInterface.php @@ -8,6 +8,9 @@ namespace Magento\Framework\App\Config; +/** + * @api + */ interface ReinitableConfigInterface extends \Magento\Framework\App\Config\MutableScopeConfigInterface { /** diff --git a/lib/internal/Magento/Framework/App/Config/Resource/ConfigInterface.php b/lib/internal/Magento/Framework/App/Config/Resource/ConfigInterface.php index aa0e06048980767a44d1f0688ebe6956bbb13355..8084c21ab0d9cd26be2319dd9cfad4e00992dae7 100644 --- a/lib/internal/Magento/Framework/App/Config/Resource/ConfigInterface.php +++ b/lib/internal/Magento/Framework/App/Config/Resource/ConfigInterface.php @@ -6,12 +6,12 @@ namespace Magento\Framework\App\Config\Resource; /** - * Resource Config Interface + * Resource for storing store configuration values */ interface ConfigInterface { /** - * Save config value + * Save config value to the storage resource * * @param string $path * @param string $value @@ -22,7 +22,7 @@ interface ConfigInterface public function saveConfig($path, $value, $scope, $scopeId); /** - * Delete config value + * Delete config value from the storage resource * * @param string $path * @param string $scope diff --git a/lib/internal/Magento/Framework/App/Config/Scope/ReaderInterface.php b/lib/internal/Magento/Framework/App/Config/Scope/ReaderInterface.php index bf20ecd1d530881e76749275afcff6dbd87939d1..cdcbb42828e51d4ff2f3e13c9449037c64ac9ad5 100644 --- a/lib/internal/Magento/Framework/App/Config/Scope/ReaderInterface.php +++ b/lib/internal/Magento/Framework/App/Config/Scope/ReaderInterface.php @@ -12,7 +12,9 @@ interface ReaderInterface /** * Read configuration scope * + * @param string|null $scopeType + * @throws \Exception May throw an exception if the given scope is invalid * @return array */ - public function read(); + public function read($scopeType = null); } diff --git a/lib/internal/Magento/Framework/App/Config/ScopeConfigInterface.php b/lib/internal/Magento/Framework/App/Config/ScopeConfigInterface.php index ac84e7358b5d2599a531ea45047d92626370bd44..e98fe284024f1780d731500d810516011b7528ba 100644 --- a/lib/internal/Magento/Framework/App/Config/ScopeConfigInterface.php +++ b/lib/internal/Magento/Framework/App/Config/ScopeConfigInterface.php @@ -8,25 +8,33 @@ namespace Magento\Framework\App\Config; +/** + * @api + */ interface ScopeConfigInterface { /** - * Retrieve config value by path and scope + * Default scope type + */ + const SCOPE_TYPE_DEFAULT = 'default'; + + /** + * Retrieve config value by path and scope. * - * @param string $path - * @param string $scope + * @param string $path The path through the tree of configuration values, e.g., 'general/store_information/name' + * @param string $scopeType The scope to use to determine config value, e.g., 'store' or 'default' * @param null|string $scopeCode * @return mixed */ - public function getValue($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null); + public function getValue($path, $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null); /** * Retrieve config flag by path and scope * - * @param string $path - * @param string $scope + * @param string $path The path through the tree of configuration values, e.g., 'general/store_information/name' + * @param string $scopeType The scope to use to determine config value, e.g., 'store' or 'default' * @param null|string $scopeCode * @return bool */ - public function isSetFlag($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeCode = null); + public function isSetFlag($path, $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null); } diff --git a/lib/internal/Magento/Framework/App/Config/ScopePool.php b/lib/internal/Magento/Framework/App/Config/ScopePool.php index 34b24deb0028b63402dc2d169f2dbb47566dae9d..1a15575b1a514a0a0a04b728e454c2c18ef0645e 100644 --- a/lib/internal/Magento/Framework/App/Config/ScopePool.php +++ b/lib/internal/Magento/Framework/App/Config/ScopePool.php @@ -5,6 +5,8 @@ */ namespace Magento\Framework\App\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; + class ScopePool { const CACHE_TAG = 'config_scopes'; @@ -78,7 +80,7 @@ class ScopePool $data = unserialize($data); } else { $reader = $this->_readerPool->getReader($scopeType); - if ($scopeType === \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT) { + if ($scopeType === ScopeConfigInterface::SCOPE_TYPE_DEFAULT) { $data = $reader->read(); } else { $data = $reader->read($scopeCode); @@ -111,7 +113,7 @@ class ScopePool protected function _getScopeCode($scopeType, $scopeCode) { if (($scopeCode === null || is_numeric($scopeCode)) - && $scopeType !== \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + && $scopeType !== ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) { $scopeResolver = $this->_scopeResolverPool->get($scopeType); $scopeCode = $scopeResolver->getScope($scopeCode); diff --git a/lib/internal/Magento/Framework/App/Config/Storage/Writer.php b/lib/internal/Magento/Framework/App/Config/Storage/Writer.php index b98e4074efa1b953fac38e02be2bbe435568d8c5..63b5ae83dfec68c85f61ebf17ae11396b485373e 100644 --- a/lib/internal/Magento/Framework/App/Config/Storage/Writer.php +++ b/lib/internal/Magento/Framework/App/Config/Storage/Writer.php @@ -7,6 +7,8 @@ */ namespace Magento\Framework\App\Config\Storage; +use Magento\Framework\App\Config\ScopeConfigInterface; + class Writer implements \Magento\Framework\App\Config\Storage\WriterInterface { /** @@ -32,7 +34,7 @@ class Writer implements \Magento\Framework\App\Config\Storage\WriterInterface * @param int $scopeId * @return void */ - public function delete($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0) + public function delete($path, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0) { $this->_resource->deleteConfig(rtrim($path, '/'), $scope, $scopeId); } @@ -46,7 +48,7 @@ class Writer implements \Magento\Framework\App\Config\Storage\WriterInterface * @param int $scopeId * @return void */ - public function save($path, $value, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0) + public function save($path, $value, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0) { $this->_resource->saveConfig(rtrim($path, '/'), $value, $scope, $scopeId); } diff --git a/lib/internal/Magento/Framework/App/Config/Storage/WriterInterface.php b/lib/internal/Magento/Framework/App/Config/Storage/WriterInterface.php index 3a3a3af6241361ca757699bf1d1e37ecfab6ad45..67b2aebd5d4a6da8d19eaad74175ca26726a57e0 100644 --- a/lib/internal/Magento/Framework/App/Config/Storage/WriterInterface.php +++ b/lib/internal/Magento/Framework/App/Config/Storage/WriterInterface.php @@ -7,6 +7,8 @@ */ namespace Magento\Framework\App\Config\Storage; +use Magento\Framework\App\Config\ScopeConfigInterface; + interface WriterInterface { /** @@ -17,7 +19,7 @@ interface WriterInterface * @param int $scopeId * @return void */ - public function delete($path, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0); + public function delete($path, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0); /** * Save config value to storage @@ -28,5 +30,5 @@ interface WriterInterface * @param int $scopeId * @return void */ - public function save($path, $value, $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, $scopeId = 0); + public function save($path, $value, $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeId = 0); } diff --git a/lib/internal/Magento/Framework/App/Config/Value.php b/lib/internal/Magento/Framework/App/Config/Value.php index 17c50d20b8b3a854cb7f61a319ba5d21b21e1dac..64263bc7b69e8b3b6520d6ca65d5251a6cc77d32 100644 --- a/lib/internal/Magento/Framework/App/Config/Value.php +++ b/lib/internal/Magento/Framework/App/Config/Value.php @@ -4,6 +4,7 @@ * See COPYING.txt for license details. */ namespace Magento\Framework\App\Config; +use Magento\Framework\App\Config\ScopeConfigInterface; /** * Config data model @@ -91,7 +92,7 @@ class Value extends \Magento\Framework\Model\AbstractModel implements \Magento\F { return (string)$this->_config->getValue( $this->getPath(), - $this->getScope() ?: \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + $this->getScope() ?: ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $this->getScopeCode() ); } diff --git a/lib/internal/Magento/Framework/App/MutableScopeConfig.php b/lib/internal/Magento/Framework/App/MutableScopeConfig.php index c94fb73f9d5e4cb35ddf246710bf464a932a25ad..418817465bd6f11af59b2ae5f4eaf53eea7559cd 100644 --- a/lib/internal/Magento/Framework/App/MutableScopeConfig.php +++ b/lib/internal/Magento/Framework/App/MutableScopeConfig.php @@ -9,6 +9,7 @@ namespace Magento\Framework\App; use Magento\Framework\App\Config\MutableScopeConfigInterface; +use Magento\Framework\App\Config\ScopeConfigInterface; class MutableScopeConfig extends Config implements MutableScopeConfigInterface { @@ -24,7 +25,7 @@ class MutableScopeConfig extends Config implements MutableScopeConfigInterface public function setValue( $path, $value, - $scope = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, + $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode = null ) { if (empty($scopeCode)) { diff --git a/lib/internal/Magento/Framework/App/Request/Http.php b/lib/internal/Magento/Framework/App/Request/Http.php index c09ead13054e791d5e6bff403623545b4e24f9e6..e6e502cf38171387aef13cdf606845d082f8664d 100644 --- a/lib/internal/Magento/Framework/App/Request/Http.php +++ b/lib/internal/Magento/Framework/App/Request/Http.php @@ -7,6 +7,7 @@ */ namespace Magento\Framework\App\Request; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\RequestInterface; use Magento\Framework\App\Route\ConfigInterface\Proxy as ConfigInterface; use Magento\Framework\HTTP\PhpEnvironment\Request; @@ -384,7 +385,7 @@ class Http extends Request implements RequestInterface $offLoaderHeader = trim( (string)$config->getValue( self::XML_PATH_OFFLOADER_HEADER, - \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT + ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) ); diff --git a/lib/internal/Magento/Framework/App/Resource.php b/lib/internal/Magento/Framework/App/Resource.php index b38629a460a4fa8a7ed78c1a9e77450ec23c1c8a..b498ec9d349fea88b942b42d2ff6277c23a2449a 100644 --- a/lib/internal/Magento/Framework/App/Resource.php +++ b/lib/internal/Magento/Framework/App/Resource.php @@ -126,6 +126,7 @@ class Resource * @param string|string[] $modelEntity * @param string $connectionName * @return string + * @api */ public function getTableName($modelEntity, $connectionName = self::DEFAULT_READ_RESOURCE) { diff --git a/lib/internal/Magento/Framework/App/Route/ConfigInterface.php b/lib/internal/Magento/Framework/App/Route/ConfigInterface.php index c6798f7ce4ab659e813488a155d0aa467ac41449..d96a4af89eac0d2a4c3932995643c1cbccec25e5 100644 --- a/lib/internal/Magento/Framework/App/Route/ConfigInterface.php +++ b/lib/internal/Magento/Framework/App/Route/ConfigInterface.php @@ -1,12 +1,15 @@ <?php /** - * Routes configuration interface - * * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Framework\App\Route; +/** + * Routes configuration interface + * + * @api + */ interface ConfigInterface { /** @@ -32,7 +35,7 @@ interface ConfigInterface * * @param string $frontName * @param string $scope - * @return array + * @return string[] */ public function getModulesByFrontName($frontName, $scope = null); } diff --git a/lib/internal/Magento/Framework/App/ScopeInterface.php b/lib/internal/Magento/Framework/App/ScopeInterface.php index d244ec5bf3a1f612722795b72e938fef77f1102f..77c8a8b890ac209400fdf8005636ee869d8ecfd0 100644 --- a/lib/internal/Magento/Framework/App/ScopeInterface.php +++ b/lib/internal/Magento/Framework/App/ScopeInterface.php @@ -7,11 +7,6 @@ namespace Magento\Framework\App; interface ScopeInterface { - /** - * Default scope type - */ - const SCOPE_DEFAULT = 'default'; - /** * Retrieve scope code * diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Config/Storage/WriterTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Config/Storage/WriterTest.php index 57040f09ee4dd82eb4ec80df99f0b827cc859573..887a1cf477663f00253816aed0bfdd273cd6fe5f 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Config/Storage/WriterTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Config/Storage/WriterTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\App\Test\Unit\Config\Storage; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\App\ScopeInterface; class WriterTest extends \PHPUnit_Framework_TestCase @@ -40,7 +41,7 @@ class WriterTest extends \PHPUnit_Framework_TestCase { $this->resource->expects($this->once()) ->method('deleteConfig') - ->with('path', ScopeInterface::SCOPE_DEFAULT, 0); + ->with('path', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0); $this->model->delete('path'); } @@ -58,7 +59,7 @@ class WriterTest extends \PHPUnit_Framework_TestCase { $this->resource->expects($this->once()) ->method('saveConfig') - ->with('path', 'value', ScopeInterface::SCOPE_DEFAULT, 0); + ->with('path', 'value', ScopeConfigInterface::SCOPE_TYPE_DEFAULT, 0); $this->model->save('path', 'value'); } } diff --git a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php index 090580da2726653983a7ed76ec9f16405393092f..8bfb9be2f3bb253932ba96c59d11d9819b704b50 100644 --- a/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php +++ b/lib/internal/Magento/Framework/App/Test/Unit/Request/HttpTest.php @@ -9,6 +9,7 @@ namespace Magento\Framework\App\Test\Unit\Request; +use Magento\Framework\App\Config\ScopeConfigInterface; use \Magento\Framework\App\Request\Http; use Magento\Framework\App\ScopeInterface; use Zend\Stdlib\Parameters; @@ -325,7 +326,7 @@ class HttpTest extends \PHPUnit_Framework_TestCase ->getMock(); $configMock->expects($this->exactly($configCall)) ->method('getValue') - ->with(\Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER, ScopeInterface::SCOPE_DEFAULT) + ->with(\Magento\Framework\App\Request\Http::XML_PATH_OFFLOADER_HEADER, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) ->willReturn($configOffloadHeader); $this->objectManager->expects($this->exactly($configCall)) ->method('get') diff --git a/lib/internal/Magento/Framework/Locale/ConfigInterface.php b/lib/internal/Magento/Framework/Locale/ConfigInterface.php index 3539f09409a800e83665f16d58871797f96161d0..e0f28fd015c33675eaed0445956c7a728a5e0d84 100644 --- a/lib/internal/Magento/Framework/Locale/ConfigInterface.php +++ b/lib/internal/Magento/Framework/Locale/ConfigInterface.php @@ -5,19 +5,24 @@ */ namespace Magento\Framework\Locale; +/** + * Provides access to locale-related config information + * + * @api + */ interface ConfigInterface { /** * Get list pre-configured allowed locales * - * @return array + * @return string[] */ public function getAllowedLocales(); /** * Get list pre-configured allowed currencies * - * @return array + * @return string[] */ public function getAllowedCurrencies(); } diff --git a/lib/internal/Magento/Framework/Locale/Currency.php b/lib/internal/Magento/Framework/Locale/Currency.php index 5d3c5a9ec9b7e961d870e4a458bc4b3fa69b5b89..f0be6c12172278b8e3a32b86848f296cd606d96a 100644 --- a/lib/internal/Magento/Framework/Locale/Currency.php +++ b/lib/internal/Magento/Framework/Locale/Currency.php @@ -7,6 +7,10 @@ namespace Magento\Framework\Locale; class Currency implements \Magento\Framework\Locale\CurrencyInterface { + /** + * Default currency + */ + const DEFAULT_CURRENCY = 'USD'; /** * @var array */ @@ -45,20 +49,15 @@ class Currency implements \Magento\Framework\Locale\CurrencyInterface } /** - * Retrieve currency code - * - * @return string + * @inheritdoc */ public function getDefaultCurrency() { - return \Magento\Framework\Locale\CurrencyInterface::DEFAULT_CURRENCY; + return self::DEFAULT_CURRENCY; } /** - * Create \Zend_Currency object for current locale - * - * @param string $currency - * @return \Magento\Framework\Currency + * @inheritdoc */ public function getCurrency($currency) { diff --git a/lib/internal/Magento/Framework/Locale/CurrencyInterface.php b/lib/internal/Magento/Framework/Locale/CurrencyInterface.php index 774f7d5120f3cead8f11e9d7545928e62634faa2..00bbc4452eedd604d19cb9144d1f38e9417e9568 100644 --- a/lib/internal/Magento/Framework/Locale/CurrencyInterface.php +++ b/lib/internal/Magento/Framework/Locale/CurrencyInterface.php @@ -5,27 +5,22 @@ */ namespace Magento\Framework\Locale; +/** + * Provides access to currency config information + * + * @api + */ interface CurrencyInterface { /** - * Default currency - */ - const DEFAULT_CURRENCY = 'USD'; - - /** - * XML path to installed currencies - */ - const XML_PATH_ALLOW_CURRENCIES_INSTALLED = 'system/currency/installed'; - - /** - * Retrieve currency code + * Retrieve default currency code * * @return string */ public function getDefaultCurrency(); /** - * Create \Magento\Framework\Currency object for current locale + * Create Currency object for current locale * * @param string $currency * @return \Magento\Framework\Currency diff --git a/lib/internal/Magento/Framework/Locale/Resolver.php b/lib/internal/Magento/Framework/Locale/Resolver.php index b78be470920ec0638dd4a8a786d13b97470277f3..6a81f60cc5a0cda5d7d55a31f7f9b599e905c94a 100644 --- a/lib/internal/Magento/Framework/Locale/Resolver.php +++ b/lib/internal/Magento/Framework/Locale/Resolver.php @@ -9,6 +9,10 @@ use Magento\Framework\App\Config\ScopeConfigInterface; class Resolver implements ResolverInterface { + /** + * Default locale + */ + const DEFAULT_LOCALE = 'en_US'; /** * Default locale code * @@ -85,7 +89,7 @@ class Resolver implements ResolverInterface if (!$this->defaultLocale) { $locale = $this->scopeConfig->getValue($this->getDefaultLocalePath(), $this->scopeType); if (!$locale) { - $locale = ResolverInterface::DEFAULT_LOCALE; + $locale = self::DEFAULT_LOCALE; } $this->defaultLocale = $locale; } diff --git a/lib/internal/Magento/Framework/Locale/ResolverInterface.php b/lib/internal/Magento/Framework/Locale/ResolverInterface.php index 08add444266f073aaa354935b6857be2c7edd34f..a17932ed8628870f7ce9f086946807498c836807 100644 --- a/lib/internal/Magento/Framework/Locale/ResolverInterface.php +++ b/lib/internal/Magento/Framework/Locale/ResolverInterface.php @@ -5,13 +5,13 @@ */ namespace Magento\Framework\Locale; +/** + * Manages locale config information + * + * @api + */ interface ResolverInterface { - /** - * Default locale - */ - const DEFAULT_LOCALE = 'en_US'; - /** * Return path to default locale * diff --git a/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php b/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php index 01552d3a972294bd649141074cc91f985829743b..226e8d4d8508be64e2a9a9454aeaa94cbb3de243 100644 --- a/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php +++ b/lib/internal/Magento/Framework/Locale/Test/Unit/CurrencyTest.php @@ -8,6 +8,7 @@ namespace Magento\Framework\Locale\Test\Unit; +use Magento\Framework\Locale\Currency; use Magento\Framework\Locale\CurrencyInterface; class CurrencyTest extends \PHPUnit_Framework_TestCase @@ -68,7 +69,7 @@ class CurrencyTest extends \PHPUnit_Framework_TestCase public function testGetDefaultCurrency() { - $expectedDefaultCurrency = CurrencyInterface::DEFAULT_CURRENCY; + $expectedDefaultCurrency = Currency::DEFAULT_CURRENCY; $retrievedDefaultCurrency = $this->testCurrencyObject->getDefaultCurrency(); $this->assertEquals($expectedDefaultCurrency, $retrievedDefaultCurrency); } diff --git a/lib/internal/Magento/Framework/Locale/Validator.php b/lib/internal/Magento/Framework/Locale/Validator.php index b30727562c45755db8b67dfb00be40c18bae09fc..0cdf265af01b329f3a87eca97ac8de8c723902b6 100644 --- a/lib/internal/Magento/Framework/Locale/Validator.php +++ b/lib/internal/Magento/Framework/Locale/Validator.php @@ -29,10 +29,12 @@ class Validator } /** - * Validate locale code + * Validate locale code. Code must be in the list of allowed locales. * * @param string $localeCode * @return bool + * + * @api */ public function isValid($localeCode) { diff --git a/lib/internal/Magento/Framework/Message/Factory.php b/lib/internal/Magento/Framework/Message/Factory.php index 4c16064b5b6599dbb98f48307601dfff7eda1ee3..be7e3c9bb566a041c026a5916f4e51364e06b07d 100644 --- a/lib/internal/Magento/Framework/Message/Factory.php +++ b/lib/internal/Magento/Framework/Message/Factory.php @@ -45,11 +45,12 @@ class Factory } /** - * Create message instance with specified parameters + * Create a message instance of a given type with given text. * - * @param string $type - * @param string $text - * @throws \InvalidArgumentException + * @param string $type The message type to create, must correspond to a message type under the + * namespace Magento\Framework\Message\ + * @param string $text The text to inject into the message + * @throws \InvalidArgumentException Exception gets thrown if type does not correspond to a valid Magento message * @return MessageInterface */ public function create($type, $text) diff --git a/lib/internal/Magento/Framework/Message/Manager.php b/lib/internal/Magento/Framework/Message/Manager.php index 73b212a58e3ee88769bd653a815c15ecafde2578..815296c80bad2d8453564f10797ade913a2e5c7f 100644 --- a/lib/internal/Magento/Framework/Message/Manager.php +++ b/lib/internal/Magento/Framework/Message/Manager.php @@ -14,6 +14,10 @@ use Psr\Log\LoggerInterface as Logger; */ class Manager implements ManagerInterface { + /** + * Default message group + */ + const DEFAULT_GROUP = 'default'; /** * @var Session */ @@ -74,9 +78,7 @@ class Manager implements ManagerInterface } /** - * Retrieve default message group - * - * @return string + * {@inheritdoc} */ public function getDefaultGroup() { @@ -95,7 +97,7 @@ class Manager implements ManagerInterface } /** - * Retrieve messages + * @inheritdoc * * @param string|null $group * @param bool $clear @@ -118,7 +120,7 @@ class Manager implements ManagerInterface } /** - * Adding new message to message collection + * @inheritdoc * * @param MessageInterface $message * @param string|null $group @@ -133,7 +135,7 @@ class Manager implements ManagerInterface } /** - * Adding messages array to message collection + * @inheritdoc * * @param MessageInterface[] $messages * @param string|null $group @@ -148,7 +150,7 @@ class Manager implements ManagerInterface } /** - * Adding new error message + * @inheritdoc * * @param string $message * @param string|null $group @@ -161,7 +163,7 @@ class Manager implements ManagerInterface } /** - * Adding new warning message + * @inheritdoc * * @param string $message * @param string|null $group @@ -174,7 +176,7 @@ class Manager implements ManagerInterface } /** - * Adding new notice message + * @inheritdoc * * @param string $message * @param string|null $group @@ -187,7 +189,7 @@ class Manager implements ManagerInterface } /** - * Adding new success message + * @inheritdoc * * @param string $message * @param string|null $group @@ -200,7 +202,7 @@ class Manager implements ManagerInterface } /** - * Adds messages array to message collection, but doesn't add duplicates to it + * @inheritdoc * * @param MessageInterface[]|MessageInterface $messages * @param string|null $group @@ -244,7 +246,7 @@ class Manager implements ManagerInterface } /** - * Not Magento exception handling + * @inheritdoc * * @param \Exception $exception * @param string $alternativeText diff --git a/lib/internal/Magento/Framework/Message/ManagerInterface.php b/lib/internal/Magento/Framework/Message/ManagerInterface.php index 36851dc866c49be7c9e0f0ea15490c79b776db4a..dd73d2a2fcfbc8acbd9aabdef42a3f5d59616f4d 100644 --- a/lib/internal/Magento/Framework/Message/ManagerInterface.php +++ b/lib/internal/Magento/Framework/Message/ManagerInterface.php @@ -6,15 +6,12 @@ namespace Magento\Framework\Message; /** - * Message manager interface + * Adds different types of messages to the session, and allows access to existing messages. + * + * @api */ interface ManagerInterface { - /** - * Default message group - */ - const DEFAULT_GROUP = 'default'; - /** * Retrieve messages * @@ -32,7 +29,7 @@ interface ManagerInterface public function getDefaultGroup(); /** - * Adding new message to message collection + * Adds new message to message collection * * @param MessageInterface $message * @param string|null $group @@ -41,7 +38,7 @@ interface ManagerInterface public function addMessage(MessageInterface $message, $group = null); /** - * Adding messages array to message collection + * Adds messages array to message collection * * @param array $messages * @param string|null $group @@ -50,7 +47,7 @@ interface ManagerInterface public function addMessages(array $messages, $group = null); /** - * Adding new error message + * Adds new error message * * @param string $message * @param string|null $group @@ -59,7 +56,7 @@ interface ManagerInterface public function addError($message, $group = null); /** - * Adding new warning message + * Adds new warning message * * @param string $message * @param string|null $group @@ -68,7 +65,7 @@ interface ManagerInterface public function addWarning($message, $group = null); /** - * Adding new notice message + * Adds new notice message * * @param string $message * @param string|null $group @@ -77,7 +74,7 @@ interface ManagerInterface public function addNotice($message, $group = null); /** - * Adding new success message + * Adds new success message * * @param string $message * @param string|null $group @@ -86,7 +83,7 @@ interface ManagerInterface public function addSuccess($message, $group = null); /** - * Adds messages array to message collection, but doesn't add duplicates to it + * Adds messages array to message collection, without adding duplicate messages * * @param array|MessageInterface $messages * @param string|null $group @@ -95,7 +92,7 @@ interface ManagerInterface public function addUniqueMessages($messages, $group = null); /** - * Not Magento exception handling + * Adds a message describing an exception. Does not contain Exception handling logic. * * @param \Exception $exception * @param string $alternativeText diff --git a/lib/internal/Magento/Framework/Message/MessageInterface.php b/lib/internal/Magento/Framework/Message/MessageInterface.php index e5342f49ac042e79fb0b572fca328a1285ab8b22..d9d60e047b1713fd6a6288a86b2a7b74b8ddae0a 100644 --- a/lib/internal/Magento/Framework/Message/MessageInterface.php +++ b/lib/internal/Magento/Framework/Message/MessageInterface.php @@ -6,7 +6,9 @@ namespace Magento\Framework\Message; /** - * Interface for message + * Represent a message with a type, content text, and an isSticky attribute to prevent message from being cleared. + * + * @api */ interface MessageInterface { diff --git a/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php b/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php index c4980974bc289f00167474eb50040197e020cb66..d65a5459a4ee92dae76a266743cb03d39c3220b6 100644 --- a/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php +++ b/lib/internal/Magento/Framework/Message/Test/Unit/ManagerTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\Message\Test\Unit; +use Magento\Framework\Message\Manager; use Magento\Framework\Message\MessageInterface; use Magento\Framework\Message\ManagerInterface; @@ -86,7 +87,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase public function testGetDefaultGroup() { - $this->assertEquals(ManagerInterface::DEFAULT_GROUP, $this->model->getDefaultGroup()); + $this->assertEquals(Manager::DEFAULT_GROUP, $this->model->getDefaultGroup()); $customDefaultGroup = 'some_group'; $customManager = $this->objectManager->getObject( @@ -117,7 +118,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase )->method( 'getData' )->with( - ManagerInterface::DEFAULT_GROUP + Manager::DEFAULT_GROUP )->will( $this->returnValue(null) ); @@ -126,7 +127,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase )->method( 'setData' )->with( - ManagerInterface::DEFAULT_GROUP, + Manager::DEFAULT_GROUP, $messageCollection )->will( $this->returnValue($this->session) @@ -136,7 +137,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase )->method( 'getData' )->with( - ManagerInterface::DEFAULT_GROUP + Manager::DEFAULT_GROUP )->will( $this->returnValue($messageCollection) ); @@ -161,7 +162,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase )->method( 'getData' )->with( - ManagerInterface::DEFAULT_GROUP + Manager::DEFAULT_GROUP )->will( $this->returnValue($messageCollection) ); @@ -209,7 +210,7 @@ class ManagerTest extends \PHPUnit_Framework_TestCase )->method( 'getData' )->with( - ManagerInterface::DEFAULT_GROUP + Manager::DEFAULT_GROUP )->will( $this->returnValue($messageCollection) ); diff --git a/lib/internal/Magento/Framework/Model/Resource/AbstractResource.php b/lib/internal/Magento/Framework/Model/Resource/AbstractResource.php index 831dcf5ae71fb2f832a7372efd8abdfe49a0ac40..c2a9bd81aad960e498303fae9f00a0f333a26272 100644 --- a/lib/internal/Magento/Framework/Model/Resource/AbstractResource.php +++ b/lib/internal/Magento/Framework/Model/Resource/AbstractResource.php @@ -61,6 +61,7 @@ abstract class AbstractResource * Start resource transaction * * @return $this + * @api */ public function beginTransaction() { @@ -73,6 +74,7 @@ abstract class AbstractResource * * @param array $callback * @return $this + * @api */ public function addCommitCallback($callback) { @@ -85,6 +87,7 @@ abstract class AbstractResource * Commit resource transaction * * @return $this + * @api */ public function commit() { @@ -109,6 +112,7 @@ abstract class AbstractResource * Roll back resource transaction * * @return $this + * @api */ public function rollBack() { diff --git a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php index 351365b08d9eb57d45b6b65a50c53edbb93d482c..ba80e64a256222d7d02ac7eaae6cd95f7ec3717a 100644 --- a/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php +++ b/lib/internal/Magento/Framework/Model/Resource/Db/AbstractDb.php @@ -233,6 +233,7 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso * * @throws LocalizedException * @return string + * @api */ public function getIdFieldName() { @@ -248,6 +249,7 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso * * @throws LocalizedException * @return string + * @api */ public function getMainTable() { @@ -262,6 +264,7 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso * * @param string $tableName * @return string + * @api */ public function getTable($tableName) { @@ -391,6 +394,7 @@ abstract class AbstractDb extends \Magento\Framework\Model\Resource\AbstractReso * @param \Magento\Framework\Model\AbstractModel $object * @return $this * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @api */ public function save(\Magento\Framework\Model\AbstractModel $object) { diff --git a/lib/internal/Magento/Framework/Object/Copy.php b/lib/internal/Magento/Framework/Object/Copy.php index 9145e0aba3bc9b9a106863967d2b7c5a3bd8b124..c0d87722872490ec10c4b15efb33fc3f2385fd33 100644 --- a/lib/internal/Magento/Framework/Object/Copy.php +++ b/lib/internal/Magento/Framework/Object/Copy.php @@ -47,6 +47,8 @@ class Copy * @param array|\Magento\Framework\Object $target * @param string $root * @return array|\Magento\Framework\Object|null the value of $target + * + * @api */ public function copyFieldsetToTarget($fieldset, $aspect, $source, $target, $root = 'global') { @@ -91,6 +93,8 @@ class Copy * @param array|\Magento\Framework\Object $source * @param string $root * @return array $data + * + * @api */ public function getDataFromFieldset($fieldset, $aspect, $source, $root = 'global') { diff --git a/lib/internal/Magento/Framework/Search/Dynamic/DataProviderFactory.php b/lib/internal/Magento/Framework/Search/Dynamic/DataProviderFactory.php index 1cfc1477a7957b46fe1f58f752749b3d8a4193a2..1b534b4dbf4991c3c5f71f2b8009bd6efd9f20df 100644 --- a/lib/internal/Magento/Framework/Search/Dynamic/DataProviderFactory.php +++ b/lib/internal/Magento/Framework/Search/Dynamic/DataProviderFactory.php @@ -33,7 +33,7 @@ class DataProviderFactory ScopeConfigInterface $scopeConfig, $configPath, $dataProviders, - $scope = ScopeInterface::SCOPE_DEFAULT + $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) { $this->objectManager = $objectManager; $configValue = $scopeConfig->getValue($configPath, $scope); diff --git a/lib/internal/Magento/Framework/Search/Dynamic/IntervalFactory.php b/lib/internal/Magento/Framework/Search/Dynamic/IntervalFactory.php index bba9824e19083f82aa5c249338bf16d2d4da5575..80ac66bb04e62950ae6a7d4dedc4e0fd8dd148d4 100644 --- a/lib/internal/Magento/Framework/Search/Dynamic/IntervalFactory.php +++ b/lib/internal/Magento/Framework/Search/Dynamic/IntervalFactory.php @@ -33,7 +33,7 @@ class IntervalFactory ScopeConfigInterface $scopeConfig, $configPath, $intervals, - $scope = ScopeInterface::SCOPE_DEFAULT + $scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT ) { $this->objectManager = $objectManager; $configValue = $scopeConfig->getValue($configPath, $scope); diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/DimensionsTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/DimensionsTest.php index 3b37a0bf3d574e10044e2bdea2f8c4b2c2eccebb..5b0736c5fa2ef890b1362bae14c6d9b70f38bf97 100644 --- a/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/DimensionsTest.php +++ b/lib/internal/Magento/Framework/Search/Test/Unit/Adapter/Mysql/DimensionsTest.php @@ -6,6 +6,7 @@ namespace Magento\Framework\Search\Test\Unit\Adapter\Mysql; +use Magento\Framework\App\Config\ScopeConfigInterface; use \Magento\Framework\Search\Adapter\Mysql\Dimensions; use Magento\Framework\Search\Adapter\Mysql\Dimensions as DimensionsBuilder; @@ -103,7 +104,7 @@ class DimensionsTest extends \PHPUnit_Framework_TestCase { $tableAlias = 'search_index'; $name = 'scope'; - $value = \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT; + $value = ScopeConfigInterface::SCOPE_TYPE_DEFAULT; $scopeId = -123456; $this->dimension->expects($this->once()) diff --git a/lib/internal/Magento/Framework/Search/Test/Unit/Dynamic/IntervalFactoryTest.php b/lib/internal/Magento/Framework/Search/Test/Unit/Dynamic/IntervalFactoryTest.php index 0d7b52e00630adde68df4600dd353d1d7e314207..232f789de3ae77014a26ee1e251dbcce6235d0e5 100644 --- a/lib/internal/Magento/Framework/Search/Test/Unit/Dynamic/IntervalFactoryTest.php +++ b/lib/internal/Magento/Framework/Search/Test/Unit/Dynamic/IntervalFactoryTest.php @@ -5,6 +5,7 @@ */ namespace Magento\Framework\Search\Test\Unit\Dynamic; +use Magento\Framework\App\Config\ScopeConfigInterface; use Magento\Framework\Search\Dynamic\IntervalInterface; use Magento\Framework\App\ScopeInterface; use Magento\Framework\TestFramework\Unit\Helper\ObjectManager; @@ -63,7 +64,7 @@ class IntervalFactoryTest extends \PHPUnit_Framework_TestCase { $this->scopeConfig->expects($this->once()) ->method('getValue') - ->with(self::CONFIG_PATH, ScopeInterface::SCOPE_DEFAULT) + ->with(self::CONFIG_PATH, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) ->willReturn(self::CONFIG_PATH . 't'); $this->objectManager->expects($this->once()) ->method('create') @@ -83,7 +84,7 @@ class IntervalFactoryTest extends \PHPUnit_Framework_TestCase { $this->scopeConfig->expects($this->once()) ->method('getValue') - ->with(self::CONFIG_PATH, ScopeInterface::SCOPE_DEFAULT) + ->with(self::CONFIG_PATH, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) ->willReturn('t'); $this->factoryCreate(); @@ -97,7 +98,7 @@ class IntervalFactoryTest extends \PHPUnit_Framework_TestCase { $this->scopeConfig->expects($this->once()) ->method('getValue') - ->with(self::CONFIG_PATH, ScopeInterface::SCOPE_DEFAULT) + ->with(self::CONFIG_PATH, ScopeConfigInterface::SCOPE_TYPE_DEFAULT) ->willReturn(self::CONFIG_PATH . 't'); $this->objectManager->expects($this->once()) ->method('create') diff --git a/lib/internal/Magento/Framework/Url/ScopeResolverInterface.php b/lib/internal/Magento/Framework/Url/ScopeResolverInterface.php index 893443659220d4b68e5ec3514f25beb0ea3c7725..a31ae25c76ea41a6efea88d85ccfb5c424092143 100644 --- a/lib/internal/Magento/Framework/Url/ScopeResolverInterface.php +++ b/lib/internal/Magento/Framework/Url/ScopeResolverInterface.php @@ -10,7 +10,7 @@ interface ScopeResolverInterface extends \Magento\Framework\App\ScopeResolverInt /** * Retrieve area code * - * @return \Magento\Framework\Url\ScopeInterface[] + * @return string|null */ public function getAreaCode(); } diff --git a/lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php b/lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php index bd18ebe344f884734c1b78233ed278c6c8b6b440..6f552656be534c3322b7f778a769fb55c83a366c 100644 --- a/lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php +++ b/lib/internal/Magento/Framework/View/Test/Unit/Element/MessagesTest.php @@ -9,6 +9,7 @@ */ namespace Magento\Framework\View\Test\Unit\Element; +use Magento\Framework\Message\Manager; use \Magento\Framework\View\Element\Messages; use Magento\Framework\Message\ManagerInterface; @@ -229,7 +230,7 @@ class MessagesTest extends \PHPUnit_Framework_TestCase $this->assertEquals($emptyMessagesCacheKey, $this->messages->getCacheKeyInfo()); $messagesCacheKey = ['storage_types' => 'a:1:{i:0;s:7:"default";}']; - $this->messages->addStorageType(ManagerInterface::DEFAULT_GROUP); + $this->messages->addStorageType(Manager::DEFAULT_GROUP); $this->assertEquals($messagesCacheKey, $this->messages->getCacheKeyInfo()); } diff --git a/setup/src/Magento/Setup/Model/Lists.php b/setup/src/Magento/Setup/Model/Lists.php index e898ed40c16c383ac2fa1ccadbdab2419aae793d..e52e921594caec60421e975f3782c8abf552ac13 100644 --- a/setup/src/Magento/Setup/Model/Lists.php +++ b/setup/src/Magento/Setup/Model/Lists.php @@ -10,6 +10,7 @@ use Magento\Framework\Locale\Bundle\CurrencyBundle; use Magento\Framework\Locale\Bundle\LanguageBundle; use Magento\Framework\Locale\Bundle\RegionBundle; use Magento\Framework\Locale\ConfigInterface; +use Magento\Framework\Locale\Resolver; use Magento\Framework\Locale\ResolverInterface; class Lists @@ -42,7 +43,7 @@ class Lists $list[$code] = \IntlTimeZone::createTimeZone($code)->getDisplayName( false, \IntlTimeZone::DISPLAY_LONG, - ResolverInterface::DEFAULT_LOCALE + Resolver::DEFAULT_LOCALE ) . ' (' . $code . ')'; } asort($list); @@ -56,7 +57,7 @@ class Lists */ public function getCurrencyList() { - $currencies = (new CurrencyBundle())->get(ResolverInterface::DEFAULT_LOCALE)['Currencies']; + $currencies = (new CurrencyBundle())->get(Resolver::DEFAULT_LOCALE)['Currencies']; $list = []; foreach ($currencies as $code => $data) { $list[$code] = $data[1] . ' (' . $code . ')'; @@ -72,8 +73,8 @@ class Lists */ public function getLocaleList() { - $languages = (new LanguageBundle())->get(ResolverInterface::DEFAULT_LOCALE)['Languages']; - $countries = (new RegionBundle())->get(ResolverInterface::DEFAULT_LOCALE)['Countries']; + $languages = (new LanguageBundle())->get(Resolver::DEFAULT_LOCALE)['Languages']; + $countries = (new RegionBundle())->get(Resolver::DEFAULT_LOCALE)['Countries']; $locales = \ResourceBundle::getLocales(null); $list = [];