Skip to content

Commit 654c898

Browse files
author
silinmykola
committed
fix after a CR
1 parent f18ca37 commit 654c898

File tree

14 files changed

+34
-58
lines changed

14 files changed

+34
-58
lines changed

app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
use Magento\Framework\DB\Adapter\AdapterInterface;
2727
use Magento\Framework\Event\ManagerInterface;
2828
use Magento\Framework\Event\Observer;
29-
use Magento\Framework\Exception\LocalizedException;
3029
use Magento\Framework\Lock\LockManagerInterface;
3130
use Magento\Framework\Model\AbstractModel;
3231
use Magento\Framework\Process\PhpExecutableFinderFactory;
@@ -657,7 +656,6 @@ public function dispatchExceptionInCallbackDataProvider(): array
657656
* Test case, successfully run job.
658657
*
659658
* @return void
660-
* @throws Exception
661659
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
662660
*/
663661
public function testDispatchRunJob(): void
@@ -763,7 +761,6 @@ function ($callback) {
763761
* Testing _generate(), iterate over saved cron jobs.
764762
*
765763
* @return void
766-
* @throws Exception
767764
*/
768765
public function testDispatchNotGenerate(): void
769766
{
@@ -817,7 +814,6 @@ public function testDispatchNotGenerate(): void
817814
* Testing _generate(), iterate over saved cron jobs and generate jobs.
818815
*
819816
* @return void
820-
* @throws Exception
821817
*/
822818
public function testDispatchGenerate(): void
823819
{
@@ -894,7 +890,6 @@ public function testDispatchGenerate(): void
894890
* Test case without saved cron jobs in data base.
895891
*
896892
* @return void
897-
* @throws Exception
898893
*/
899894
public function testDispatchCleanup(): void
900895
{
@@ -959,7 +954,6 @@ public function testDispatchCleanup(): void
959954

960955
/**
961956
* @return void
962-
* @throws LocalizedException
963957
*/
964958
public function testMissedJobsCleanedInTime(): void
965959
{

app/code/Magento/Customer/Controller/Adminhtml/Index/InlineEdit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
use Magento\Customer\Model\EmailNotificationInterface;
1313
use Magento\Customer\Ui\Component\Listing\AttributeRepository;
1414
use Magento\Framework\App\Action\HttpPostActionInterface;
15-
use Magento\Framework\App\ObjectManager;
1615
use Magento\Framework\Exception\NoSuchEntityException;
1716
use Magento\Framework\Message\MessageInterface;
17+
use Magento\Framework\App\ObjectManager;
1818

1919
/**
2020
* Customer inline edit action
@@ -179,7 +179,7 @@ protected function getData(array $data, $isCustomerData = null)
179179
$addressKeys = preg_grep(
180180
'/^(' . AttributeRepository::BILLING_ADDRESS_PREFIX . '\w+)/',
181181
array_keys($data),
182-
(int) $isCustomerData
182+
$isCustomerData
183183
);
184184
$result = array_intersect_key($data, array_flip($addressKeys));
185185
if ($isCustomerData === null) {

app/code/Magento/Customer/Model/FileProcessor.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ public function saveTemporaryFile($fileId)
215215
);
216216

217217
$result = $uploader->save($path);
218-
if ($result && isset($result['path'])) {
219-
unset($result['path']);
220-
}
218+
unset($result['path']);
221219
if (!$result) {
222220
throw new LocalizedException(
223221
__('File can not be saved to the destination folder.')

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class Multiselect extends Select
1414
{
1515
/**
16-
* @inheritdoc
16+
* {@inheritdoc}
1717
*/
1818
public function extractValue(RequestInterface $request)
1919
{
@@ -25,7 +25,7 @@ public function extractValue(RequestInterface $request)
2525
}
2626

2727
/**
28-
* @inheritdoc
28+
* {@inheritdoc}
2929
*/
3030
public function compactValue($value)
3131
{
@@ -40,13 +40,13 @@ public function compactValue($value)
4040
}
4141

4242
/**
43-
* @inheritdoc
43+
* {@inheritdoc}
4444
*/
4545
public function outputValue($format = ElementFactory::OUTPUT_FORMAT_TEXT)
4646
{
4747
$values = $this->_value;
4848
if (!is_array($values)) {
49-
$values = explode(',', (string) $values);
49+
$values = explode(',', $values);
5050
}
5151

5252
if (ElementFactory::OUTPUT_FORMAT_ARRAY === $format || ElementFactory::OUTPUT_FORMAT_JSON === $format) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ private function validateLength($value, AttributeMetadataInterface $attribute, a
126126
// validate length
127127
$label = __($attribute->getStoreLabel());
128128

129-
$length = $this->_string->strlen(trim((string) $value));
129+
$length = $this->_string->strlen(trim($value));
130130

131131
$validateRules = $attribute->getValidationRules();
132132

app/code/Magento/Customer/Test/Unit/Block/Adminhtml/Edit/Tab/View/PersonalInfoTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public function getStoreLastLoginDateDataProvider()
246246
{
247247
return [
248248
['2015-03-04 12:00:00', '2015-03-04 12:00:00'],
249-
['Never', '']
249+
['Never', null]
250250
];
251251
}
252252

app/code/Magento/Customer/Test/Unit/Model/AccountManagementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,7 @@ public function testCreateAccountWithPasswordHashWithCustomerAddresses(): void
23632363
private function prepareDateTimeFactory(): string
23642364
{
23652365
$dateTime = '2017-10-25 18:57:08';
2366-
$timestamp = 1508983028;
2366+
$timestamp = '1508983028';
23672367
$dateTimeMock = $this->createMock(\DateTime::class);
23682368
$dateTimeMock->expects($this->any())
23692369
->method('format')

app/code/Magento/Customer/Test/Unit/Model/Metadata/Form/FileTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function testExtractValueNoRequestScope($expected, $attributeCode = '', $
130130
'entityTypeCode' => self::ENTITY_TYPE,
131131
]
132132
);
133-
$model->setRequestScope('');
133+
134134
$this->assertEquals($expected, $model->extractValue($this->requestMock));
135135
if (!empty($attributeCode)) {
136136
unset($_FILES[$attributeCode]);

app/code/Magento/Customer/Test/Unit/Model/ResourceModel/GroupTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,6 @@ public function testSaveWithReservedId()
131131
->willReturn([]);
132132
$this->groupModel->expects($this->once())->method('setId')
133133
->with($expectedId);
134-
$this->groupModel->expects($this->once())->method('getCode')
135-
->willReturn('');
136134

137135
$dbAdapter = $this->getMockBuilder(AdapterInterface::class)
138136
->disableOriginalConstructor()

app/code/Magento/ImportExport/Model/Import/AbstractEntity.php

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
*
2424
* phpcs:disable Magento2.Classes.AbstractApi
2525
* @api
26-
*
2726
* @SuppressWarnings(PHPMD.TooManyFields)
2827
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2928
* @since 100.0.2
@@ -40,20 +39,24 @@ abstract class AbstractEntity
4039
*/
4140
const COLUMN_ACTION_VALUE_DELETE = 'delete';
4241

43-
/**#@+
44-
* XML paths to parameters
42+
/**
43+
* Path to bunch size configuration
4544
*/
4645
const XML_PATH_BUNCH_SIZE = 'import/format_v2/bunch_size';
4746

47+
/**
48+
* Path to page size configuration
49+
*/
4850
const XML_PATH_PAGE_SIZE = 'import/format_v2/page_size';
4951

50-
/**#@-*/
51-
52-
/**#@+
53-
* Database constants
52+
/**
53+
* Size of varchar value
5454
*/
5555
const DB_MAX_VARCHAR_LENGTH = 256;
5656

57+
/**
58+
* Size of text value
59+
*/
5760
const DB_MAX_TEXT_LENGTH = 65536;
5861

5962
const ERROR_CODE_SYSTEM_EXCEPTION = 'systemException';
@@ -90,8 +93,6 @@ abstract class AbstractEntity
9093
. ", see acceptable values on settings specified for Admin",
9194
];
9295

93-
/**#@-*/
94-
9596
/**
9697
* @var AdapterInterface
9798
*/
@@ -311,21 +312,20 @@ public function __construct(
311312
array $data = [],
312313
Json $serializer = null
313314
) {
315+
$this->string = $string;
314316
$this->_scopeConfig = $scopeConfig;
315317
$this->_dataSourceModel = $data['data_source_model'] ?? $importFactory->create()->getDataSourceModel();
318+
$this->_maxDataSize = $data['max_data_size'] ?? $resourceHelper->getMaxDataSize();
316319
$this->_connection = $data['connection'] ?? $resource->getConnection();
317-
$this->string = $string;
318-
$this->_pageSize = $data['page_size'] ?? (static::XML_PATH_PAGE_SIZE ? (int)$this->_scopeConfig->getValue(
320+
$this->errorAggregator = $errorAggregator;
321+
$this->_pageSize = $data['page_size'] ?? ((int) $this->_scopeConfig->getValue(
319322
static::XML_PATH_PAGE_SIZE,
320323
ScopeInterface::SCOPE_STORE
321-
) : 0);
322-
$this->_maxDataSize = $data['max_data_size'] ?? $resourceHelper->getMaxDataSize();
323-
$this->_bunchSize = $data['bunch_size'] ?? (static::XML_PATH_BUNCH_SIZE ? (int)$this->_scopeConfig->getValue(
324+
) ?: 0);
325+
$this->_bunchSize = $data['bunch_size'] ?? ((int) $this->_scopeConfig->getValue(
324326
static::XML_PATH_BUNCH_SIZE,
325327
ScopeInterface::SCOPE_STORE
326-
) : 0);
327-
328-
$this->errorAggregator = $errorAggregator;
328+
) ?: 0);
329329

330330
foreach ($this->errorMessageTemplates as $errorCode => $message) {
331331
$this->getErrorAggregator()->addErrorMessageTemplate($errorCode, $message);

0 commit comments

Comments
 (0)