Skip to content

Commit c581b45

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into develop
2 parents 38f56d4 + 2f74dea commit c581b45

File tree

185 files changed

+293
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+293
-299
lines changed

Diff for: app/code/Magento/Customer/Model/Customer/Attribute/Source/Website.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(
3838
public function getAllOptions()
3939
{
4040
if (!$this->_options) {
41-
$this->_options = $this->_store->getWebsiteValuesForForm(true, true);
41+
$this->_options = $this->_store->getWebsiteValuesForForm(false, true);
4242
}
4343

4444
return $this->_options;

Diff for: app/code/Magento/Integration/Model/Oauth/Token/Factory.php

-35
This file was deleted.

Diff for: app/code/Magento/Integration/Model/Oauth/Token/Provider.php

+7-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Provider implements TokenProviderInterface
1717
protected $_consumerFactory;
1818

1919
/**
20-
* @var \Magento\Integration\Model\Oauth\Token\Factory
20+
* @var \Magento\Integration\Model\Oauth\TokenFactory
2121
*/
2222
protected $_tokenFactory;
2323

@@ -31,30 +31,22 @@ class Provider implements TokenProviderInterface
3131
*/
3232
protected $_date;
3333

34-
/**
35-
* @var Token
36-
*/
37-
protected $token;
38-
3934
/**
4035
* @param \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory
41-
* @param \Magento\Integration\Model\Oauth\Token\Factory $tokenFactory
36+
* @param \Magento\Integration\Model\Oauth\TokenFactory $tokenFactory
4237
* @param \Magento\Integration\Helper\Oauth\Data $dataHelper
4338
* @param \Magento\Framework\Stdlib\DateTime\DateTime $date
44-
* @param Token $token
4539
*/
4640
public function __construct(
4741
\Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory,
48-
\Magento\Integration\Model\Oauth\Token\Factory $tokenFactory,
42+
\Magento\Integration\Model\Oauth\TokenFactory $tokenFactory,
4943
\Magento\Integration\Helper\Oauth\Data $dataHelper,
50-
\Magento\Framework\Stdlib\DateTime\DateTime $date,
51-
Token $token
44+
\Magento\Framework\Stdlib\DateTime\DateTime $date
5245
) {
5346
$this->_consumerFactory = $consumerFactory;
5447
$this->_tokenFactory = $tokenFactory;
5548
$this->_dataHelper = $dataHelper;
5649
$this->_date = $date;
57-
$this->token = $token;
5850
}
5951

6052
/**
@@ -293,7 +285,9 @@ protected function _getToken($token)
293285
*/
294286
public function getIntegrationTokenByConsumerId($consumerId)
295287
{
296-
$token = $this->token->loadByConsumerIdAndUserType($consumerId, UserContextInterface::USER_TYPE_INTEGRATION);
288+
/** @var \Magento\Integration\Model\Oauth\Token $token */
289+
$token = $this->_tokenFactory->create();
290+
$token->loadByConsumerIdAndUserType($consumerId, UserContextInterface::USER_TYPE_INTEGRATION);
297291

298292
if (!$token->getId()) {
299293
throw new \Magento\Framework\Oauth\Exception(

Diff for: app/code/Magento/Integration/Service/V1/AdminTokenService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Framework\Exception\LocalizedException;
1010
use Magento\Integration\Helper\Validator;
1111
use Magento\Integration\Model\Oauth\Token as Token;
12-
use Magento\Integration\Model\Oauth\Token\Factory as TokenModelFactory;
12+
use Magento\Integration\Model\Oauth\TokenFactory as TokenModelFactory;
1313
use Magento\Integration\Model\Resource\Oauth\Token\CollectionFactory as TokenCollectionFactory;
1414
use Magento\User\Model\User as UserModel;
1515

Diff for: app/code/Magento/Integration/Service/V1/CustomerTokenService.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Framework\Exception\LocalizedException;
1010
use Magento\Integration\Helper\Validator;
1111
use Magento\Integration\Model\Oauth\Token as Token;
12-
use Magento\Integration\Model\Oauth\Token\Factory as TokenModelFactory;
12+
use Magento\Integration\Model\Oauth\TokenFactory as TokenModelFactory;
1313
use Magento\Integration\Model\Resource\Oauth\Token\CollectionFactory as TokenCollectionFactory;
1414

1515
class CustomerTokenService implements CustomerTokenServiceInterface

Diff for: app/code/Magento/Integration/Service/V1/Oauth.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Magento\Integration\Model\Oauth\Consumer as ConsumerModel;
1010
use Magento\Integration\Model\Oauth\Consumer\Factory as ConsumerFactory;
1111
use Magento\Integration\Model\Oauth\Token as OauthTokenModel;
12-
use Magento\Integration\Model\Oauth\Token\Factory as TokenFactory;
12+
use Magento\Integration\Model\Oauth\TokenFactory as TokenFactory;
1313
use Magento\Integration\Model\Oauth\Token\Provider as TokenProvider;
1414

1515
/**

Diff for: app/code/Magento/Tax/Controller/Adminhtml/Tax/IgnoreTaxNotification.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function execute()
3939
if ($section) {
4040
try {
4141
$path = 'tax/notification/ignore_' . $section;
42-
$this->_objectManager->get('\Magento\Core\Model\Resource\Config')
42+
$this->_objectManager->get('Magento\Core\Model\Resource\Config')
4343
->saveConfig($path, 1, \Magento\Framework\App\ScopeInterface::SCOPE_DEFAULT, 0);
4444
} catch (\Exception $e) {
4545
$this->messageManager->addError($e->getMessage());

Diff for: app/code/Magento/User/Controller/Adminhtml/User/InvalidateToken.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function execute()
1818
{
1919
if ($userId = $this->getRequest()->getParam('user_id')) {
2020
/** @var \Magento\Integration\Service\V1\AdminTokenService $tokenService */
21-
$tokenService = $this->_objectManager->get('\Magento\Integration\Service\V1\AdminTokenService');
21+
$tokenService = $this->_objectManager->get('Magento\Integration\Service\V1\AdminTokenService');
2222
try {
2323
$tokenService->revokeAdminAccessToken($userId);
2424
$this->messageManager->addSuccess(__('You have revoked the user\'s tokens.'));

Diff for: app/code/Magento/User/Controller/Adminhtml/User/Role.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,36 @@ class Role extends \Magento\Backend\App\AbstractAction
4343
*/
4444
protected $_authSession;
4545

46+
/**
47+
* @var \Magento\Framework\Filter\FilterManager
48+
*/
49+
protected $_filterManager;
50+
4651
/**
4752
* @param \Magento\Backend\App\Action\Context $context
4853
* @param \Magento\Framework\Registry $coreRegistry
4954
* @param \Magento\Authorization\Model\RoleFactory $roleFactory
5055
* @param \Magento\User\Model\UserFactory $userFactory
5156
* @param \Magento\Authorization\Model\RulesFactory $rulesFactory
5257
* @param \Magento\Backend\Model\Auth\Session $authSession
58+
* @param \Magento\Framework\Filter\FilterManager $filterManager
5359
*/
5460
public function __construct(
5561
\Magento\Backend\App\Action\Context $context,
5662
\Magento\Framework\Registry $coreRegistry,
5763
\Magento\Authorization\Model\RoleFactory $roleFactory,
5864
\Magento\User\Model\UserFactory $userFactory,
5965
\Magento\Authorization\Model\RulesFactory $rulesFactory,
60-
\Magento\Backend\Model\Auth\Session $authSession
66+
\Magento\Backend\Model\Auth\Session $authSession,
67+
\Magento\Framework\Filter\FilterManager $filterManager
6168
) {
6269
parent::__construct($context);
6370
$this->_coreRegistry = $coreRegistry;
6471
$this->_roleFactory = $roleFactory;
6572
$this->_userFactory = $userFactory;
6673
$this->_rulesFactory = $rulesFactory;
6774
$this->_authSession = $authSession;
75+
$this->_filterManager = $filterManager;
6876
}
6977

7078
/**

Diff for: app/code/Magento/User/Controller/Adminhtml/User/Role/SaveRole.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function execute()
7878
}
7979

8080
try {
81-
$roleName = $this->getRequest()->getParam('rolename', false);
81+
$roleName = $this->_filterManager->removeTags($this->getRequest()->getParam('rolename', false));
8282

8383
$role->setName($roleName)
8484
->setPid($this->getRequest()->getParam('parent_id', false))

Diff for: app/code/Magento/Webapi/Model/Config/ClassReflector.php

+20-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use Zend\Server\Reflection;
88
use Zend\Server\Reflection\ReflectionMethod;
9+
use Zend\Code\Reflection\MethodReflection;
910

1011
/**
1112
* Class reflector.
@@ -84,7 +85,7 @@ public function reflectClassMethods($className, $methods)
8485
*/
8586
public function extractMethodData(ReflectionMethod $method)
8687
{
87-
$methodData = ['documentation' => $method->getDescription(), 'interface' => []];
88+
$methodData = ['documentation' => $this->extractMethodDescription($method), 'interface' => []];
8889
$prototypes = $method->getPrototypes();
8990
/** Take the fullest interface that also includes optional parameters. */
9091
/** @var \Zend\Server\Reflection\Prototype $prototype */
@@ -111,4 +112,22 @@ public function extractMethodData(ReflectionMethod $method)
111112

112113
return $methodData;
113114
}
115+
116+
/**
117+
* Retrieve method full documentation description.
118+
*
119+
* @param ReflectionMethod $method
120+
* @return string
121+
*/
122+
protected function extractMethodDescription(ReflectionMethod $method)
123+
{
124+
$methodReflection = new MethodReflection(
125+
$method->getDeclaringClass()->getName(),
126+
$method->getName()
127+
);
128+
129+
$docBlock = $methodReflection->getDocBlock();
130+
131+
return $this->_typeProcessor->getDescription($docBlock);
132+
}
114133
}

Diff for: dev/tests/functional/lib/Mtf/App/State/AbstractState.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function apply()
3838
*/
3939
public function clearInstance()
4040
{
41-
$dirList = \Mtf\ObjectManagerFactory::getObjectManager()->get('\Magento\Framework\Filesystem\DirectoryList');
41+
$dirList = \Mtf\ObjectManagerFactory::getObjectManager()->get('Magento\Framework\Filesystem\DirectoryList');
4242
$deploymentConfig = new \Magento\Framework\App\DeploymentConfig(
4343
new \Magento\Framework\App\DeploymentConfig\Reader($dirList),
4444
[]

Diff for: dev/tests/functional/tests/app/Magento/Store/Test/TestCase/StoreTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ protected function setUp()
2626
public function testCreateNewLocalizedStoreView()
2727
{
2828
$objectManager = Factory::getObjectManager();
29-
$storeFixture = $objectManager->create('\Magento\Store\Test\Fixture\Store', ['dataSet' => 'german']);
29+
$storeFixture = $objectManager->create('Magento\Store\Test\Fixture\Store', ['dataSet' => 'german']);
3030

3131
$storeListPage = Factory::getPageFactory()->getAdminSystemStore();
3232
$storeListPage->open();

Diff for: dev/tests/functional/tests/app/Magento/Tax/Test/Constraint/AbstractAssertTaxWithCrossBorderApplying.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ protected function getCartPrice(CatalogProductSimple $product, $actualPrices)
179179
protected function loginCustomer($customer)
180180
{
181181
$this->objectManager->create(
182-
'\Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep',
182+
'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep',
183183
['customer' => $customer]
184184
)->run();
185185
}

Diff for: dev/tests/functional/tests/app/Magento/Tax/Test/TestCase/TaxRuleTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function testCreateTaxRule()
2727
{
2828
//Data
2929
$objectManager = Factory::getObjectManager();
30-
$fixture = $objectManager->create('\Magento\Tax\Test\Fixture\TaxRule', ['dataSet' => 'us_ca_ny_rule']);
30+
$fixture = $objectManager->create('Magento\Tax\Test\Fixture\TaxRule', ['dataSet' => 'us_ca_ny_rule']);
3131
//Pages
3232
$taxGridPage = Factory::getPageFactory()->getTaxRuleIndex();
3333
$newTaxRulePage = Factory::getPageFactory()->getTaxRuleNew();

Diff for: dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractConfigFiles.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function getXmlConfigFiles()
133133
$directory = $objectManager->get('Magento\Framework\Filesystem')
134134
->getDirectoryRead(DirectoryList::MODULES);
135135

136-
return $objectManager->get('\Magento\Framework\Config\FileIteratorFactory')
136+
return $objectManager->get('Magento\Framework\Config\FileIteratorFactory')
137137
->create($directory, $directory->search($this->_getConfigFilePathGlob()));
138138
}
139139

Diff for: dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ protected function _getColumnSetMock()
106106
'Magento\Framework\View\Element\Template\Context',
107107
[
108108
'filesystem' => $objectManager->create(
109-
'\Magento\Framework\Filesystem',
109+
'Magento\Framework\Filesystem',
110110
['directoryList' => $directoryList]
111111
)
112112
]

Diff for: dev/tests/integration/testsuite/Magento/Backend/Model/AuthTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function testLogout()
8080
\Magento\TestFramework\Bootstrap::ADMIN_PASSWORD
8181
);
8282
$this->assertNotEmpty($this->_model->getAuthStorage()->getData());
83-
$cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('\Magento\Framework\Stdlib\Cookie');
83+
$cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Framework\Stdlib\Cookie');
8484
$cookie->set($this->_model->getAuthStorage()->getName(), 'session_id');
8585
$this->_model->logout();
8686
$this->assertEmpty($this->_model->getAuthStorage()->getData());

Diff for: dev/tests/integration/testsuite/Magento/Catalog/Block/Product/NewTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function setUp()
2222
* @var \Magento\Customer\Api\GroupManagementInterface $groupManagement
2323
*/
2424
$groupManagement = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
25-
->get('\Magento\Customer\Api\GroupManagementInterface');
25+
->get('Magento\Customer\Api\GroupManagementInterface');
2626
$notLoggedInId = $groupManagement->getNotLoggedInGroup()->getId();
2727

2828
\Magento\TestFramework\Helper\Bootstrap::getInstance()->loadArea(\Magento\Framework\App\Area::AREA_FRONTEND);

Diff for: dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/FlatTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function setUp()
2222
'Magento\Catalog\Helper\Product\Flat\Indexer'
2323
);
2424
$this->_state = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
25-
'\Magento\Catalog\Model\Indexer\Product\Flat\State'
25+
'Magento\Catalog\Model\Indexer\Product\Flat\State'
2626
);
2727
}
2828

Diff for: dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/FullTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ public function testReindexAll()
3838
$this->_processor->reindexAll();
3939

4040
$categoryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
41-
'\Magento\Catalog\Model\CategoryFactory'
41+
'Magento\Catalog\Model\CategoryFactory'
4242
);
4343
/** @var \Magento\Catalog\Block\Product\ListProduct $listProduct */
4444
$listProduct = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
45-
'\Magento\Catalog\Block\Product\ListProduct'
45+
'Magento\Catalog\Block\Product\ListProduct'
4646
);
4747

4848
$category = $categoryFactory->create()->load(2);

Diff for: dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/RowTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ public function testUpdateProduct()
3333
$product->save();
3434

3535
$categoryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
36-
'\Magento\Catalog\Model\CategoryFactory'
36+
'Magento\Catalog\Model\CategoryFactory'
3737
);
3838
/** @var \Magento\Catalog\Block\Product\ListProduct $listProduct */
3939
$listProduct = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
40-
'\Magento\Catalog\Block\Product\ListProduct'
40+
'Magento\Catalog\Block\Product\ListProduct'
4141
);
4242

4343
$category = $categoryFactory->create()->load(2);

Diff for: dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Eav/Action/RowsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ public function testUpdateAttributes()
4242
);
4343

4444
$categoryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
45-
'\Magento\Catalog\Model\CategoryFactory'
45+
'Magento\Catalog\Model\CategoryFactory'
4646
);
4747
/** @var \Magento\Catalog\Block\Product\ListProduct $listProduct */
4848
$listProduct = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
49-
'\Magento\Catalog\Block\Product\ListProduct'
49+
'Magento\Catalog\Block\Product\ListProduct'
5050
);
5151

5252
$category = $categoryFactory->create()->load(2);

Diff for: dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/FullTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public function testReindexAll()
3131
$this->_processor->reindexAll();
3232

3333
$categoryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
34-
'\Magento\Catalog\Model\CategoryFactory'
34+
'Magento\Catalog\Model\CategoryFactory'
3535
);
3636
$listProduct = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
37-
'\Magento\Catalog\Block\Product\ListProduct'
37+
'Magento\Catalog\Block\Product\ListProduct'
3838
);
3939

4040
$category = $categoryFactory->create()->load(2);

Diff for: dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ protected function setUp()
3737
public function testProductUpdate()
3838
{
3939
$categoryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
40-
'\Magento\Catalog\Model\CategoryFactory'
40+
'Magento\Catalog\Model\CategoryFactory'
4141
);
4242
$listProduct = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
43-
'\Magento\Catalog\Block\Product\ListProduct'
43+
'Magento\Catalog\Block\Product\ListProduct'
4444
);
4545

4646
$this->_processor->getIndexer()->setScheduled(false);

Diff for: dev/tests/integration/testsuite/Magento/Catalog/Model/Indexer/Product/Price/Action/RowsTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ public function testProductsUpdate()
4141
$this->_processor->reindexList([$this->_product->getId()]);
4242

4343
$categoryFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
44-
'\Magento\Catalog\Model\CategoryFactory'
44+
'Magento\Catalog\Model\CategoryFactory'
4545
);
4646
$listProduct = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
47-
'\Magento\Catalog\Block\Product\ListProduct'
47+
'Magento\Catalog\Block\Product\ListProduct'
4848
);
4949

5050
$category = $categoryFactory->create()->load(9);

0 commit comments

Comments
 (0)