Skip to content

Commit 9c53b7c

Browse files
author
Stanislav Idolov
committed
magento-engcom/magento2ce#2299: Code style fixes
1 parent d06f1c2 commit 9c53b7c

File tree

12 files changed

+135
-48
lines changed

12 files changed

+135
-48
lines changed

app/code/Magento/AsynchronousOperations/Controller/Adminhtml/Bulk/Details.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Class View Operation Details Controller
1010
*/
11-
class Details extends \Magento\Backend\App\Action
11+
class Details extends \Magento\Backend\App\Action implements \Magento\Framework\App\Action\HttpGetActionInterface
1212
{
1313
/**
1414
* @var \Magento\Framework\View\Result\PageFactory

app/code/Magento/Backend/App/Request/BackendValidator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public function __construct(
7777
}
7878

7979
/**
80+
* Validate request
81+
*
8082
* @param RequestInterface $request
8183
* @param ActionInterface $action
8284
*
@@ -115,6 +117,8 @@ private function validateRequest(
115117
}
116118

117119
/**
120+
* Create exception
121+
*
118122
* @param RequestInterface $request
119123
* @param ActionInterface $action
120124
*

app/code/Magento/Backend/Block/Widget/Grid/Column/Filter/Theme.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010
namespace Magento\Backend\Block\Widget\Grid\Column\Filter;
1111

12+
/**
13+
* Theme grid filter
14+
*/
1215
class Theme extends \Magento\Backend\Block\Widget\Grid\Column\Filter\AbstractFilter
1316
{
1417
/**
@@ -55,6 +58,7 @@ public function getHtml()
5558

5659
/**
5760
* Retrieve options set in column.
61+
*
5862
* Or load if options was not set.
5963
*
6064
* @return array

app/code/Magento/Backend/Block/Widget/Tabs.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Magento\Backend\Block\Widget\Tab\TabInterface;
99

1010
/**
11+
* Tabs widget
12+
*
1113
* @api
1214
* @SuppressWarnings(PHPMD.NumberOfChildren)
1315
* @since 100.0.2
@@ -178,6 +180,8 @@ protected function _addTabByName($tab, $tabId)
178180
}
179181

180182
/**
183+
* Get active tab id
184+
*
181185
* @return string
182186
*/
183187
public function getActiveTabId()
@@ -187,6 +191,7 @@ public function getActiveTabId()
187191

188192
/**
189193
* Set Active Tab
194+
*
190195
* Tab has to be not hidden and can show
191196
*
192197
* @param string $tabId
@@ -231,7 +236,7 @@ protected function _setActiveTab($tabId)
231236
}
232237

233238
/**
234-
* {@inheritdoc}
239+
* @inheritdoc
235240
*/
236241
protected function _beforeToHtml()
237242
{
@@ -282,6 +287,8 @@ private function reorderTabs()
282287
}
283288

284289
/**
290+
* Apply tabs order
291+
*
285292
* @param array $orderByPosition
286293
* @param array $orderByIdentity
287294
*
@@ -294,7 +301,7 @@ private function applyTabsCorrectOrder(array $orderByPosition, array $orderByIde
294301
/**
295302
* Rearrange the positions by using the after tag for each tab.
296303
*
297-
* @var integer $position
304+
* @var int $position
298305
* @var TabInterface $tab
299306
*/
300307
foreach ($orderByPosition as $position => $tab) {
@@ -338,6 +345,8 @@ private function finalTabsSortOrder(array $orderByPosition)
338345
}
339346

340347
/**
348+
* Get js object name
349+
*
341350
* @return string
342351
*/
343352
public function getJsObjectName()
@@ -346,6 +355,8 @@ public function getJsObjectName()
346355
}
347356

348357
/**
358+
* Get tabs ids
359+
*
349360
* @return string[]
350361
*/
351362
public function getTabsIds()
@@ -358,6 +369,8 @@ public function getTabsIds()
358369
}
359370

360371
/**
372+
* Get tab id
373+
*
361374
* @param \Magento\Framework\DataObject|TabInterface $tab
362375
* @param bool $withPrefix
363376
* @return string
@@ -371,6 +384,8 @@ public function getTabId($tab, $withPrefix = true)
371384
}
372385

373386
/**
387+
* CVan show tab
388+
*
374389
* @param \Magento\Framework\DataObject|TabInterface $tab
375390
* @return bool
376391
*/
@@ -383,6 +398,8 @@ public function canShowTab($tab)
383398
}
384399

385400
/**
401+
* Get tab is hidden
402+
*
386403
* @param \Magento\Framework\DataObject|TabInterface $tab
387404
* @return bool
388405
* @SuppressWarnings(PHPMD.BooleanGetMethodName)
@@ -396,6 +413,8 @@ public function getTabIsHidden($tab)
396413
}
397414

398415
/**
416+
* Get tab url
417+
*
399418
* @param \Magento\Framework\DataObject|TabInterface $tab
400419
* @return string
401420
*/
@@ -414,6 +433,8 @@ public function getTabUrl($tab)
414433
}
415434

416435
/**
436+
* Get tab title
437+
*
417438
* @param \Magento\Framework\DataObject|TabInterface $tab
418439
* @return string
419440
*/
@@ -426,6 +447,8 @@ public function getTabTitle($tab)
426447
}
427448

428449
/**
450+
* Get tab class
451+
*
429452
* @param \Magento\Framework\DataObject|TabInterface $tab
430453
* @return string
431454
*/
@@ -441,6 +464,8 @@ public function getTabClass($tab)
441464
}
442465

443466
/**
467+
* Get tab label
468+
*
444469
* @param \Magento\Framework\DataObject|TabInterface $tab
445470
* @return string
446471
*/
@@ -453,6 +478,8 @@ public function getTabLabel($tab)
453478
}
454479

455480
/**
481+
* Get tab content
482+
*
456483
* @param \Magento\Framework\DataObject|TabInterface $tab
457484
* @return string
458485
*/
@@ -469,6 +496,7 @@ public function getTabContent($tab)
469496

470497
/**
471498
* Mark tabs as dependent of each other
499+
*
472500
* Arbitrary number of tabs can be specified, but at least two
473501
*
474502
* @param string $tabOneId

app/code/Magento/Backend/Console/Command/AbstractCacheCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
use Symfony\Component\Console\Input\InputOption;
1212

1313
/**
14+
* Abstract cache command
15+
*
1416
* @api
1517
* @since 100.0.2
1618
*/
@@ -40,7 +42,7 @@ public function __construct(Manager $cacheManager)
4042
}
4143

4244
/**
43-
* {@inheritdoc}
45+
* @inheritdoc
4446
*/
4547
protected function configure()
4648
{

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
use Magento\Catalog\Controller\Adminhtml\Product\Initialization\Helper\AttributeFilter;
2020

2121
/**
22+
* Product helper
23+
*
2224
* @api
2325
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2426
* @since 100.0.2
@@ -365,6 +367,8 @@ private function overwriteValue($optionId, $option, $overwriteOptions)
365367
}
366368

367369
/**
370+
* Get link resolver instance
371+
*
368372
* @return LinkResolver
369373
* @deprecated 101.0.0
370374
*/
@@ -377,6 +381,8 @@ private function getLinkResolver()
377381
}
378382

379383
/**
384+
* Get DateTimeFilter instance
385+
*
380386
* @return \Magento\Framework\Stdlib\DateTime\Filter\DateTime
381387
* @deprecated 101.0.0
382388
*/
@@ -391,6 +397,7 @@ private function getDateTimeFilter()
391397

392398
/**
393399
* Remove ids of non selected websites from $websiteIds array and return filtered data
400+
*
394401
* $websiteIds parameter expects array with website ids as keys and 1 (selected) or 0 (non selected) as values
395402
* Only one id (default website ID) will be set to $websiteIds array when the single store mode is turned on
396403
*

app/code/Magento/Catalog/Test/Unit/Controller/Adminhtml/Product/Initialization/HelperTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ class HelperTest extends \PHPUnit\Framework\TestCase
9595
*/
9696
protected $attributeFilterMock;
9797

98+
/**
99+
* @var \PHPUnit_Framework_MockObject_MockObject
100+
*/
101+
private $dateTimeFilterMock;
102+
98103
/**
99104
* @inheritdoc
100105
*/
@@ -170,6 +175,11 @@ protected function setUp()
170175
$resolverProperty = $helperReflection->getProperty('linkResolver');
171176
$resolverProperty->setAccessible(true);
172177
$resolverProperty->setValue($this->helper, $this->linkResolverMock);
178+
179+
$this->dateTimeFilterMock = $this->createMock(\Magento\Framework\Stdlib\DateTime\Filter\DateTime::class);
180+
$dateTimeFilterProperty = $helperReflection->getProperty('dateTimeFilter');
181+
$dateTimeFilterProperty->setAccessible(true);
182+
$dateTimeFilterProperty->setValue($this->helper, $this->dateTimeFilterMock);
173183
}
174184

175185
/**
@@ -211,6 +221,12 @@ public function testInitialize(
211221
if (!empty($tierPrice)) {
212222
$productData = array_merge($productData, ['tier_price' => $tierPrice]);
213223
}
224+
225+
$this->dateTimeFilterMock->expects($this->once())
226+
->method('filter')
227+
->with($specialFromDate)
228+
->willReturn($specialFromDate);
229+
214230
$attributeNonDate = $this->getMockBuilder(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class)
215231
->disableOriginalConstructor()
216232
->getMock();

app/code/Magento/Customer/Model/Address/AbstractAddress.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function setStreet($street)
271271
* Enforce format of the street field or other multiline custom attributes
272272
*
273273
* @param array|string $key
274-
* @param null $value
274+
* @param mixed $value
275275
* @return \Magento\Framework\DataObject
276276
*/
277277
public function setData($key, $value = null)
@@ -286,6 +286,7 @@ public function setData($key, $value = null)
286286

287287
/**
288288
* Check that address can have multiline attribute by this code (as street or some custom attribute)
289+
*
289290
* @param string $code
290291
* @return bool
291292
*/
@@ -403,6 +404,8 @@ public function getRegionCode()
403404
}
404405

405406
/**
407+
* Get region id
408+
*
406409
* @return int
407410
*/
408411
public function getRegionId()
@@ -425,6 +428,8 @@ public function getRegionId()
425428
}
426429

427430
/**
431+
* Get country
432+
*
428433
* @return string
429434
*/
430435
public function getCountry()
@@ -502,6 +507,8 @@ public function getConfig()
502507
}
503508

504509
/**
510+
* Before save handler
511+
*
505512
* @return $this
506513
*/
507514
public function beforeSave()
@@ -591,6 +598,8 @@ public function validate()
591598
}
592599

593600
/**
601+
* Create region instance
602+
*
594603
* @return \Magento\Directory\Model\Region
595604
*/
596605
protected function _createRegionInstance()
@@ -599,6 +608,8 @@ protected function _createRegionInstance()
599608
}
600609

601610
/**
611+
* Create country instance
612+
*
602613
* @return \Magento\Directory\Model\Country
603614
*/
604615
protected function _createCountryInstance()
@@ -608,6 +619,7 @@ protected function _createCountryInstance()
608619

609620
/**
610621
* Unset Region from address
622+
*
611623
* @return $this
612624
* @since 100.2.0
613625
*/
@@ -617,6 +629,8 @@ public function unsRegion()
617629
}
618630

619631
/**
632+
* Is company required
633+
*
620634
* @return bool
621635
* @since 100.2.0
622636
*/
@@ -626,6 +640,8 @@ protected function isCompanyRequired()
626640
}
627641

628642
/**
643+
* Is telephone required
644+
*
629645
* @return bool
630646
* @since 100.2.0
631647
*/
@@ -635,6 +651,8 @@ protected function isTelephoneRequired()
635651
}
636652

637653
/**
654+
* Is fax required
655+
*
638656
* @return bool
639657
* @since 100.2.0
640658
*/

app/code/Magento/Customer/Model/Metadata/Form/Text.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use Magento\Customer\Api\Data\AttributeMetadataInterface;
1212
use Magento\Framework\Api\ArrayObjectSearch;
1313

14+
/**
15+
* Form Text metadata
16+
*/
1417
class Text extends AbstractData
1518
{
1619
/**

0 commit comments

Comments
 (0)