Skip to content

Commit 675aa3d

Browse files
MAGETWO-53549: [Github][PR] Replace fabpot/php-cs-fixer with friendsofphp/php-cs-fixer magento#4791
2 parents a7d582d + 1630c06 commit 675aa3d

File tree

7,515 files changed

+90764
-50168
lines changed

Some content is hidden

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

7,515 files changed

+90764
-50168
lines changed

.php_cs

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ return Symfony\CS\Config\Config::create()
3333
'extra_empty_lines',
3434
'include',
3535
'join_function',
36-
'multiline_array_trailing_comma',
3736
'namespace_no_leading_whitespace',
3837
'new_with_braces',
3938
'object_operator',

Gruntfile.js.sample

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@
55

66
// For performance use one level down: 'name/{,*/}*.js'
77
// If you want to recursively match all subfolders, use: 'name/**/*.js'
8+
89
module.exports = function (grunt) {
910
'use strict';
1011

1112
var _ = require('underscore'),
1213
path = require('path'),
13-
themes = require('./dev/tools/grunt/configs/themes'),
14+
filesRouter = require('./dev/tools/grunt/tools/files-router'),
1415
configDir = './dev/tools/grunt/configs',
15-
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*');
16+
tasks = grunt.file.expand('./dev/tools/grunt/tasks/*'),
17+
themes;
18+
19+
filesRouter.set('themes', 'dev/tools/grunt/configs/themes');
20+
themes = filesRouter.get('themes');
1621

1722
tasks = _.map(tasks, function(task){ return task.replace('.js', '') });
1823
tasks.push('time-grunt');

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/AjaxMarkAsRead.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function execute()
2222
$responseData = [];
2323
try {
2424
$this->_objectManager->create(
25-
'Magento\AdminNotification\Model\NotificationService'
25+
\Magento\AdminNotification\Model\NotificationService::class
2626
)->markAsRead(
2727
$notificationId
2828
);
@@ -31,7 +31,7 @@ public function execute()
3131
$responseData['success'] = false;
3232
}
3333
$this->getResponse()->representJson(
34-
$this->_objectManager->create('Magento\Framework\Json\Helper\Data')->jsonEncode($responseData)
34+
$this->_objectManager->create(\Magento\Framework\Json\Helper\Data::class)->jsonEncode($responseData)
3535
);
3636
}
3737
}

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MarkAsRead.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function execute()
2424
if ($notificationId) {
2525
try {
2626
$this->_objectManager->create(
27-
'Magento\AdminNotification\Model\NotificationService'
27+
\Magento\AdminNotification\Model\NotificationService::class
2828
)->markAsRead(
2929
$notificationId
3030
);

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassMarkAsRead.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function execute()
2727
} else {
2828
try {
2929
foreach ($ids as $id) {
30-
$model = $this->_objectManager->create('Magento\AdminNotification\Model\Inbox')->load($id);
30+
$model = $this->_objectManager->create(\Magento\AdminNotification\Model\Inbox::class)->load($id);
3131
if ($model->getId()) {
3232
$model->setIsRead(1)->save();
3333
}

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/MassRemove.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function execute()
2727
} else {
2828
try {
2929
foreach ($ids as $id) {
30-
$model = $this->_objectManager->create('Magento\AdminNotification\Model\Inbox')->load($id);
30+
$model = $this->_objectManager->create(\Magento\AdminNotification\Model\Inbox::class)->load($id);
3131
if ($model->getId()) {
3232
$model->setIsRemove(1)->save();
3333
}

app/code/Magento/AdminNotification/Controller/Adminhtml/Notification/Remove.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Remove extends \Magento\AdminNotification\Controller\Adminhtml\Notificatio
2222
public function execute()
2323
{
2424
if ($id = $this->getRequest()->getParam('id')) {
25-
$model = $this->_objectManager->create('Magento\AdminNotification\Model\Inbox')->load($id);
25+
$model = $this->_objectManager->create(\Magento\AdminNotification\Model\Inbox::class)->load($id);
2626

2727
if (!$model->getId()) {
2828
$this->_redirect('adminhtml/*/');

app/code/Magento/AdminNotification/Model/Inbox.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Inbox extends \Magento\Framework\Model\AbstractModel implements NotifierIn
3838
*/
3939
protected function _construct()
4040
{
41-
$this->_init('Magento\AdminNotification\Model\ResourceModel\Inbox');
41+
$this->_init(\Magento\AdminNotification\Model\ResourceModel\Inbox::class);
4242
}
4343

4444
/**

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\Ab
1919
*/
2020
protected function _construct()
2121
{
22-
$this->_init('Magento\AdminNotification\Model\Inbox', 'Magento\AdminNotification\Model\ResourceModel\Inbox');
22+
$this->_init(
23+
\Magento\AdminNotification\Model\Inbox::class,
24+
\Magento\AdminNotification\Model\ResourceModel\Inbox::class
25+
);
2326
}
2427

2528
/**

app/code/Magento/AdminNotification/Model/ResourceModel/Inbox/Collection/Critical.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class Critical extends \Magento\Framework\Model\ResourceModel\Db\Collection\Abst
1616
*/
1717
protected function _construct()
1818
{
19-
$this->_init('Magento\AdminNotification\Model\Inbox', 'Magento\AdminNotification\Model\ResourceModel\Inbox');
19+
$this->_init(
20+
\Magento\AdminNotification\Model\Inbox::class,
21+
\Magento\AdminNotification\Model\ResourceModel\Inbox::class
22+
);
2023
}
2124

2225
/**

app/code/Magento/AdminNotification/Model/ResourceModel/System/Message/Collection.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public function __construct(
5151
protected function _construct()
5252
{
5353
$this->_init(
54-
'Magento\AdminNotification\Model\System\Message',
55-
'Magento\AdminNotification\Model\ResourceModel\System\Message'
54+
\Magento\AdminNotification\Model\System\Message::class,
55+
\Magento\AdminNotification\Model\ResourceModel\System\Message::class
5656
);
5757
}
5858

app/code/Magento/AdminNotification/Model/System/Message.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class Message extends \Magento\Framework\Model\AbstractModel implements \Magento
1515
*/
1616
protected function _construct()
1717
{
18-
$this->_init('Magento\AdminNotification\Model\ResourceModel\System\Message');
18+
$this->_init(\Magento\AdminNotification\Model\ResourceModel\System\Message::class);
1919
}
2020

2121
/**

app/code/Magento/AdminNotification/Test/Unit/Block/ToolbarEntryTest.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function _getBlockInstance($unreadNotifications)
2424
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
2525
// mock collection of unread notifications
2626
$notificationList = $this->getMock(
27-
'Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread',
27+
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class,
2828
['getSize', 'setCurPage', 'setPageSize'],
2929
[],
3030
'',
@@ -33,7 +33,7 @@ protected function _getBlockInstance($unreadNotifications)
3333
$notificationList->expects($this->any())->method('getSize')->will($this->returnValue($unreadNotifications));
3434

3535
$block = $objectManagerHelper->getObject(
36-
'Magento\AdminNotification\Block\ToolbarEntry',
36+
\Magento\AdminNotification\Block\ToolbarEntry::class,
3737
['notificationList' => $notificationList]
3838
);
3939

@@ -52,12 +52,14 @@ public function testGetLatestUnreadNotifications()
5252
$helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
5353

5454
// 1. Create mocks
55-
$notificationList = $this->getMockBuilder('Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread')
55+
$notificationList = $this->getMockBuilder(
56+
\Magento\AdminNotification\Model\ResourceModel\Inbox\Collection\Unread::class)
5657
->disableOriginalConstructor()
5758
->getMock();
5859

5960
/** @var \Magento\AdminNotification\Block\ToolbarEntry $model */
60-
$model = $helper->getObject('Magento\AdminNotification\Block\ToolbarEntry',
61+
$model = $helper->getObject(
62+
\Magento\AdminNotification\Block\ToolbarEntry::class,
6163
['notificationList' => $notificationList]
6264
);
6365

app/code/Magento/AdminNotification/Test/Unit/Model/FeedTest.php

+23-11
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,25 @@ class FeedTest extends \PHPUnit_Framework_TestCase
5252

5353
protected function setUp()
5454
{
55-
$this->inboxFactory = $this->getMock('Magento\AdminNotification\Model\InboxFactory', ['create'], [], '', false);
56-
$this->curlFactory = $this->getMock('Magento\Framework\HTTP\Adapter\CurlFactory', ['create'], [], '', false);
57-
$this->curl = $this->getMockBuilder('Magento\Framework\HTTP\Adapter\Curl')
55+
$this->inboxFactory = $this->getMock(
56+
\Magento\AdminNotification\Model\InboxFactory::class,
57+
['create'],
58+
[],
59+
'',
60+
false
61+
);
62+
$this->curlFactory = $this->getMock(
63+
\Magento\Framework\HTTP\Adapter\CurlFactory::class,
64+
['create'],
65+
[],
66+
'',
67+
false
68+
);
69+
$this->curl = $this->getMockBuilder(\Magento\Framework\HTTP\Adapter\Curl::class)
5870
->disableOriginalConstructor()->getMock();
59-
$this->appState = $this->getMock('Magento\Framework\App\State', ['getInstallDate'], [], '', false);
71+
$this->appState = $this->getMock(\Magento\Framework\App\State::class, ['getInstallDate'], [], '', false);
6072
$this->inboxModel = $this->getMock(
61-
'Magento\AdminNotification\Model\Inbox',
73+
\Magento\AdminNotification\Model\Inbox::class,
6274
[
6375
'__wakeup',
6476
'parse'
@@ -68,15 +80,15 @@ protected function setUp()
6880
false
6981
);
7082
$this->backendConfig = $this->getMock(
71-
'Magento\Backend\App\ConfigInterface',
83+
\Magento\Backend\App\ConfigInterface::class,
7284
[
7385
'getValue',
7486
'setValue',
7587
'isSetFlag'
7688
]
7789
);
7890
$this->cacheManager = $this->getMock(
79-
'Magento\Framework\App\CacheInterface',
91+
\Magento\Framework\App\CacheInterface::class,
8092
[
8193
'load',
8294
'getFrontend',
@@ -86,18 +98,18 @@ protected function setUp()
8698
]
8799
);
88100

89-
$this->deploymentConfig = $this->getMockBuilder('Magento\Framework\App\DeploymentConfig')
101+
$this->deploymentConfig = $this->getMockBuilder(\Magento\Framework\App\DeploymentConfig::class)
90102
->disableOriginalConstructor()->getMock();
91103

92104
$this->objectManagerHelper = new ObjectManagerHelper($this);
93105

94-
$this->productMetadata = $this->getMockBuilder('Magento\Framework\App\ProductMetadata')
106+
$this->productMetadata = $this->getMockBuilder(\Magento\Framework\App\ProductMetadata::class)
95107
->disableOriginalConstructor()->getMock();
96108

97-
$this->urlBuilder = $this->getMock('Magento\Framework\UrlInterface');
109+
$this->urlBuilder = $this->getMock(\Magento\Framework\UrlInterface::class);
98110

99111
$this->feed = $this->objectManagerHelper->getObject(
100-
'Magento\AdminNotification\Model\Feed',
112+
\Magento\AdminNotification\Model\Feed::class,
101113
[
102114
'backendConfig' => $this->backendConfig,
103115
'cacheManager' => $this->cacheManager,

app/code/Magento/AdminNotification/Test/Unit/Model/NotificationServiceTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ protected function _getServiceInstanceForMarkAsReadTest($notificationId)
2424
* $notificationFactory \PHPUnit_Framework_MockObject_MockObject|\Magento\AdminNotification\Model\InboxFactory
2525
*/
2626
$notificationFactory = $this->getMock(
27-
'Magento\AdminNotification\Model\InboxFactory',
27+
\Magento\AdminNotification\Model\InboxFactory::class,
2828
['create'],
2929
[],
3030
'',
3131
false
3232
);
3333
$notification = $this->getMock(
34-
'Magento\AdminNotification\Model\Inbox',
34+
\Magento\AdminNotification\Model\Inbox::class,
3535
['load', 'getId', 'save', 'setIsRead', '__sleep', '__wakeup'],
3636
[],
3737
'',

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/CacheOutdatedTest.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class CacheOutdatedTest extends \PHPUnit_Framework_TestCase
2929

3030
protected function setUp()
3131
{
32-
$this->_authorizationMock = $this->getMock('Magento\Framework\AuthorizationInterface');
33-
$this->_urlInterfaceMock = $this->getMock('Magento\Framework\UrlInterface');
34-
$this->_cacheTypeListMock = $this->getMock('Magento\Framework\App\Cache\TypeListInterface');
32+
$this->_authorizationMock = $this->getMock(\Magento\Framework\AuthorizationInterface::class);
33+
$this->_urlInterfaceMock = $this->getMock(\Magento\Framework\UrlInterface::class);
34+
$this->_cacheTypeListMock = $this->getMock(\Magento\Framework\App\Cache\TypeListInterface::class);
3535

3636
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
3737
$arguments = [
@@ -40,7 +40,7 @@ protected function setUp()
4040
'cacheTypeList' => $this->_cacheTypeListMock,
4141
];
4242
$this->_messageModel = $objectManagerHelper->getObject(
43-
'Magento\AdminNotification\Model\System\Message\CacheOutdated',
43+
\Magento\AdminNotification\Model\System\Message\CacheOutdated::class,
4444
$arguments
4545
);
4646
}
@@ -64,10 +64,10 @@ public function testGetIdentity($expectedSum, $cacheTypes)
6464

6565
public function getIdentityDataProvider()
6666
{
67-
$cacheTypeMock1 = $this->getMock('stdClass', ['getCacheType']);
67+
$cacheTypeMock1 = $this->getMock(\stdClass::class, ['getCacheType']);
6868
$cacheTypeMock1->expects($this->any())->method('getCacheType')->will($this->returnValue('Simple'));
6969

70-
$cacheTypeMock2 = $this->getMock('stdClass', ['getCacheType']);
70+
$cacheTypeMock2 = $this->getMock(\stdClass::class, ['getCacheType']);
7171
$cacheTypeMock2->expects($this->any())->method('getCacheType')->will($this->returnValue('Advanced'));
7272

7373
return [
@@ -97,7 +97,7 @@ public function testIsDisplayed($expected, $allowed, $cacheTypes)
9797

9898
public function isDisplayedDataProvider()
9999
{
100-
$cacheTypesMock = $this->getMock('stdClass', ['getCacheType']);
100+
$cacheTypesMock = $this->getMock(\stdClass::class, ['getCacheType']);
101101
$cacheTypesMock->expects($this->any())->method('getCacheType')->will($this->returnValue('someVal'));
102102
$cacheTypes = [$cacheTypesMock, $cacheTypesMock];
103103
return [

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/Media/Synchronization/ErrorTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ class ErrorTest extends \PHPUnit_Framework_TestCase
2424

2525
protected function setUp()
2626
{
27-
$this->_syncFlagMock = $this->getMock('Magento\MediaStorage\Model\File\Storage\Flag', [], [], '', false);
27+
$this->_syncFlagMock = $this->getMock(\Magento\MediaStorage\Model\File\Storage\Flag::class, [], [], '', false);
2828

29-
$this->_fileStorage = $this->getMock('Magento\MediaStorage\Model\File\Storage\Flag', [], [], '', false);
29+
$this->_fileStorage = $this->getMock(\Magento\MediaStorage\Model\File\Storage\Flag::class, [], [], '', false);
3030
$this->_fileStorage->expects($this->any())->method('loadSelf')->will($this->returnValue($this->_syncFlagMock));
3131

3232
$objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
3333
$arguments = ['fileStorage' => $this->_fileStorage];
3434
$this->_model = $objectManagerHelper->getObject(
35-
'Magento\AdminNotification\Model\System\Message\Media\Synchronization\Error',
35+
\Magento\AdminNotification\Model\System\Message\Media\Synchronization\Error::class,
3636
$arguments
3737
);
3838
}
@@ -56,7 +56,7 @@ public function testIsDisplayed($expectedFirstRun, $data)
5656
// create new instance to ensure that it hasn't been displayed yet (var $this->_isDisplayed is unset)
5757
/** @var $model \Magento\AdminNotification\Model\System\Message\Media\Synchronization\Error */
5858
$model = $objectManagerHelper->getObject(
59-
'Magento\AdminNotification\Model\System\Message\Media\Synchronization\Error',
59+
\Magento\AdminNotification\Model\System\Message\Media\Synchronization\Error::class,
6060
$arguments
6161
);
6262

app/code/Magento/AdminNotification/Test/Unit/Model/System/Message/SecurityTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ class SecurityTest extends \PHPUnit_Framework_TestCase
3535
protected function setUp()
3636
{
3737
//Prepare objects for constructor
38-
$this->_cacheMock = $this->getMock('Magento\Framework\App\CacheInterface');
39-
$this->_scopeConfigMock = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface');
38+
$this->_cacheMock = $this->getMock(\Magento\Framework\App\CacheInterface::class);
39+
$this->_scopeConfigMock = $this->getMock(\Magento\Framework\App\Config\ScopeConfigInterface::class);
4040
$this->_curlFactoryMock = $this->getMock(
41-
'Magento\Framework\HTTP\Adapter\CurlFactory',
41+
\Magento\Framework\HTTP\Adapter\CurlFactory::class,
4242
['create'],
4343
[],
4444
'',
@@ -52,7 +52,7 @@ protected function setUp()
5252
'curlFactory' => $this->_curlFactoryMock,
5353
];
5454
$this->_messageModel = $objectManagerHelper->getObject(
55-
'Magento\AdminNotification\Model\System\Message\Security',
55+
\Magento\AdminNotification\Model\System\Message\Security::class,
5656
$arguments
5757
);
5858
}
@@ -70,7 +70,7 @@ public function testIsDisplayed($expectedResult, $cached, $response)
7070
$this->_cacheMock->expects($this->any())->method('load')->will($this->returnValue($cached));
7171
$this->_cacheMock->expects($this->any())->method('save')->will($this->returnValue(null));
7272

73-
$httpAdapterMock = $this->getMock('Magento\Framework\HTTP\Adapter\Curl', [], [], '', false);
73+
$httpAdapterMock = $this->getMock(\Magento\Framework\HTTP\Adapter\Curl::class, [], [], '', false);
7474
$httpAdapterMock->expects($this->any())->method('read')->will($this->returnValue($response));
7575
$this->_curlFactoryMock->expects($this->any())->method('create')->will($this->returnValue($httpAdapterMock));
7676

app/code/Magento/AdvancedPricingImportExport/Controller/Adminhtml/Export/GetFilter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function execute()
3030
/** @var $attrFilterBlock \Magento\ImportExport\Block\Adminhtml\Export\Filter */
3131
$attrFilterBlock = $resultLayout->getLayout()->getBlock('export.filter');
3232
/** @var $export \Magento\ImportExport\Model\Export */
33-
$export = $this->_objectManager->create('Magento\ImportExport\Model\Export');
33+
$export = $this->_objectManager->create(\Magento\ImportExport\Model\Export::class);
3434
$export->setData($data);
3535
$export->filterAttributeCollection(
3636
$attrFilterBlock->prepareCollection($export->getEntityAttributeCollection())

0 commit comments

Comments
 (0)