Skip to content

Commit 5976535

Browse files
static issue fix
1 parent 64fa569 commit 5976535

39 files changed

+639
-430
lines changed

dev/tests/unit/Magento/FunctionalTestFramework/Config/Reader/FilesystemTest.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public function testEmptyXmlFile()
4646
/**
4747
* Retrieve mocked file iterator
4848
*
49-
* @param string $fileName
50-
* @param string $content
49+
* @param string $fileName
50+
* @param string $content
5151
* @return File|MockObject
5252
* @throws \Exception
5353
*/
@@ -65,22 +65,26 @@ public function getFileIterator(string $fileName, string $content): File
6565
->willReturn(1);
6666

6767
$file->method('next')
68-
->willReturnCallback(function () use ($iterator): void {
69-
$iterator->next();
70-
});
68+
->willReturnCallback(
69+
function () use ($iterator): void {
70+
$iterator->next();
71+
}
72+
);
7173

7274
$file->method('valid')
73-
->willReturnCallback(function () use ($iterator): bool {
74-
return $iterator->valid();
75-
});
75+
->willReturnCallback(
76+
function () use ($iterator): bool {
77+
return $iterator->valid();
78+
}
79+
);
7680

7781
return $file;
7882
}
7983

8084
/**
8185
* Get real instance of Filesystem class with mocked dependencies
8286
*
83-
* @param File $fileIterator
87+
* @param File $fileIterator
8488
* @return Filesystem
8589
*/
8690
public function getFilesystem(File $fileIterator): Filesystem

dev/tests/unit/Magento/FunctionalTestFramework/Console/GenerateTestsCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
class GenerateTestsCommandTest extends TestCase
1515
{
1616
/**
17-
* @param mixed $time
18-
* @param mixed $groups
19-
* @param mixed $expected
17+
* @param mixed $time
18+
* @param mixed $groups
19+
* @param mixed $expected
2020
* @return void
2121
* @throws \ReflectionException
2222
*/

dev/tests/unit/Magento/FunctionalTestFramework/Console/RunTestFailedCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ public function testMultipleTests(): void
3737
* Invoking private method to be able to test it.
3838
* NOTE: Bad practice don't repeat it.
3939
*
40-
* @param $object
41-
* @param $methodName
42-
* @param array $parameters
40+
* @param $object
41+
* @param $methodName
42+
* @param array $parameters
4343
* @return mixed
4444
* @throws \ReflectionException
4545
*/

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Handlers/DataObjectHandlerTest.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,19 +337,19 @@ private function mockDataObjectHandlerWithData(array $mockData): void
337337
$mockObjectManagerInstance
338338
->method('create')
339339
->willReturnCallback(
340-
function (
341-
string $class,
342-
array $arguments = []
343-
) use (
344-
$objectManager,
345-
$mockDataProfileSchemaParser
346-
) {
347-
if ($class === DataProfileSchemaParser::class) {
348-
return $mockDataProfileSchemaParser;
349-
}
350-
351-
return $objectManager->create($class, $arguments);
340+
function (
341+
string $class,
342+
array $arguments = []
343+
) use (
344+
$objectManager,
345+
$mockDataProfileSchemaParser
346+
) {
347+
if ($class === DataProfileSchemaParser::class) {
348+
return $mockDataProfileSchemaParser;
352349
}
350+
351+
return $objectManager->create($class, $arguments);
352+
}
353353
);
354354

355355
$property = new ReflectionProperty(ObjectManager::class, 'instance');

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Handlers/OperationDefinitionObjectHandlerTest.php

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ public function testObjectCreation(): void
196196
* key id, value integer
197197
* key name, value string, required TRUE
198198
* key active, value boolean
199-
*
200199
*/
201200
$mockData = [
202201
OperationDefinitionObjectHandler::ENTITY_OPERATION_ROOT_TAG => [
@@ -519,19 +518,19 @@ private function mockOperationHandlerWithData(array $mockData): void
519518
$mockObjectManagerInstance
520519
->method('create')
521520
->willReturnCallback(
522-
function (
523-
string $class,
524-
array $arguments = []
525-
) use (
526-
$objectManager,
527-
$mockOperationParser
528-
) {
529-
if ($class === OperationDefinitionParser::class) {
530-
return $mockOperationParser;
531-
}
532-
533-
return $objectManager->create($class, $arguments);
521+
function (
522+
string $class,
523+
array $arguments = []
524+
) use (
525+
$objectManager,
526+
$mockOperationParser
527+
) {
528+
if ($class === OperationDefinitionParser::class) {
529+
return $mockOperationParser;
534530
}
531+
532+
return $objectManager->create($class, $arguments);
533+
}
535534
);
536535

537536
$property = new ReflectionProperty(ObjectManager::class, 'instance');

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Handlers/PersistedObjectHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ public static function entityDataProvider(): array
528528
* Create mock curl handler.
529529
*
530530
* @param string $response
531-
* @param array $parserOutput
531+
* @param array $parserOutput
532532
*
533533
* @return void
534534
*/

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Handlers/SecretStorage/AwsSecretsManagerStorageTest.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ public function testEncryptAndDecrypt()
2929
'Name' => 'mftf/magento/' . $testShortKey,
3030
'SecretString' => json_encode([$testShortKey => $testValue])
3131
];
32-
/** @var Result */
32+
/**
33+
* @var Result
34+
*/
3335
$result = new Result($data);
3436

3537
$mockClient = $this->getMockBuilder(SecretsManagerClient::class)
@@ -39,11 +41,15 @@ public function testEncryptAndDecrypt()
3941

4042
$mockClient->expects($this->once())
4143
->method('__call')
42-
->willReturnCallback(function ($name, $args) use ($result) {
43-
return $result;
44-
});
44+
->willReturnCallback(
45+
function ($name, $args) use ($result) {
46+
return $result;
47+
}
48+
);
4549

46-
/** @var SecretsManagerClient */
50+
/**
51+
* @var SecretsManagerClient
52+
*/
4753
$credentialStorage = new AwsSecretsManagerStorage($testRegion, $testProfile);
4854
$reflection = new ReflectionClass($credentialStorage);
4955
$reflection_property = $reflection->getProperty('client');

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Handlers/SecretStorage/FileStorageTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class FileStorageTest extends MagentoTestCase
1818
{
1919
/**
2020
* Test basic encryption/decryption functionality in FileStorage class.
21+
*
2122
* @throws TestFrameworkException|ReflectionException
2223
*/
2324
public function testBasicEncryptDecrypt(): void
@@ -52,6 +53,7 @@ public function testBasicEncryptDecrypt(): void
5253

5354
/**
5455
* Test empty value encryption/decryption functionality in FileStorage class.
56+
*
5557
* @return void
5658
* @throws TestFrameworkException|ReflectionException
5759
*/

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Objects/EntityDataObjectTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class EntityDataObjectTest extends MagentoTestCase
3838
{
3939
/**
4040
* Before test functionality
41+
*
4142
* @return void
4243
*/
4344
public function setUp(): void
@@ -139,6 +140,7 @@ public function testGetCamelCaseKeys()
139140

140141
/**
141142
* After class functionality
143+
*
142144
* @return void
143145
*/
144146
public static function tearDownAfterClass(): void

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Persist/OperationDataArrayResolverTest.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,13 @@ public function testNestedMetadataResolve(): void
133133
->withName('createChildType')
134134
->withOperation('create')
135135
->withType('childType')
136-
->withMetadata([
136+
->withMetadata(
137+
[
137138
'city' => 'string',
138139
'state' => 'string',
139140
'zip' => 'integer'
140-
])->build();
141+
]
142+
)->build();
141143

142144
// mock meta data object handler
143145
$this->mockOperationDefinitionObjectHandler($childOperationDefinition);
@@ -348,11 +350,13 @@ public function testNestedMetadataArrayOfValue(): void
348350
->withName('createChildType')
349351
->withOperation('create')
350352
->withType('childType')
351-
->withMetadata([
353+
->withMetadata(
354+
[
352355
'city' => 'string',
353356
'state' => 'string',
354357
'zip' => 'integer'
355-
])->build();
358+
]
359+
)->build();
356360

357361
// mock meta data object handler
358362
$this->mockOperationDefinitionObjectHandler($childOperationDefinition);
@@ -401,20 +405,24 @@ public function testNestedMetadataArrayOfDiverseObjects(): void
401405
->withName('createchildType1')
402406
->withOperation('create')
403407
->withType('childType1')
404-
->withMetadata([
408+
->withMetadata(
409+
[
405410
'city' => 'string',
406411
'zip' => 'integer'
407-
])->build();
412+
]
413+
)->build();
408414

409415
$child2OperationDefinition = $operationDefinitionBuilder
410416
->withName('createchildType2')
411417
->withOperation('create')
412418
->withType('childType2')
413-
->withMetadata([
419+
->withMetadata(
420+
[
414421
'city' => 'string',
415422
'zip' => 'integer',
416423
'state' => 'string'
417-
])->build();
424+
]
425+
)->build();
418426

419427
$operationObjectCallback = function ($name) use ($child1OperationDefinition, $child2OperationDefinition) {
420428
switch ($name) {

0 commit comments

Comments
 (0)