Skip to content

Commit 57365d2

Browse files
ACPT-1688: Fix Static Tests failures on Application-Server branch Final
1 parent f60294e commit 57365d2

File tree

10 files changed

+32
-24
lines changed

10 files changed

+32
-24
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Product/Price/Provider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class Provider implements ProviderInterface, ResetAfterRequestInterface
3737
/**
3838
* @var array|array[]
3939
*
40-
* @SuppressWarnings(PHPCS)
40+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
4141
*/
4242
private readonly array $minimalPriceConstructed;
4343

4444
/**
4545
* @var array|array[]
4646
*
47-
* @SuppressWarnings(PHPCS)
47+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
4848
*/
4949
private readonly array $maximalPriceConstructed;
5050

app/code/Magento/CatalogGraphQl/Plugin/Search/RequestBuilderPlugin.php

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
67

78
namespace Magento\CatalogGraphQl\Plugin\Search;
89

@@ -11,18 +12,26 @@
1112

1213
class RequestBuilderPlugin
1314
{
15+
/**
16+
* Constructor
17+
*
18+
* @param RequestDataBuilder $localData
19+
* @phpcs:disable Magento2.CodeAnalysis.EmptyBlock
20+
*/
1421
public function __construct(private RequestDataBuilder $localData)
1522
{
1623
}
1724

1825
/**
26+
* Get around
27+
*
1928
* @param Config $subject
2029
* @param callable $proceed
2130
* @param string $requestName
2231
* @return array
2332
*/
24-
public function aroundGet(Config $subject, callable $proceed, string $requestName) {
25-
33+
public function aroundGet(Config $subject, callable $proceed, string $requestName)
34+
{
2635
if ($this->localData->getData($requestName)) {
2736
return $this->localData->getData($requestName);
2837
} else {

app/code/Magento/CatalogGraphQl/etc/di.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@
101101
</argument>
102102
</arguments>
103103
</type>
104-
<type name="Magento\Framework\Search\Request\Config">
105-
<plugin name="localRequestDataPlugin" type="Magento\CatalogGraphQl\Plugin\Search\RequestBuilderPlugin" />
106-
</type>
107104
<type name="Magento\Framework\Search\Request\Config\FilesystemReader">
108105
<plugin name="productAttributesDynamicFields" type="Magento\CatalogGraphQl\Plugin\Search\Request\ConfigReader" />
109106
</type>
@@ -114,6 +111,7 @@
114111
<item name="EAV" xsi:type="string">EAV</item>
115112
</argument>
116113
</arguments>
114+
<plugin name="localRequestDataPlugin" type="Magento\CatalogGraphQl\Plugin\Search\RequestBuilderPlugin" />
117115
</type>
118116

119117
<preference type="Magento\CatalogGraphQl\Model\Resolver\Product\Price\Provider" for="Magento\CatalogGraphQl\Model\Resolver\Product\Price\ProviderInterface"/>

app/code/Magento/Customer/Helper/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Address extends \Magento\Framework\App\Helper\AbstractHelper implements Re
8686
* @var CustomerMetadataInterface
8787
*
8888
* @deprecated 101.0.0
89-
* phpcs:disable Magento2.Annotation.ClassPropertyPHPDocFormatting
89+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
9090
*/
9191
protected $_customerMetadataService;
9292

dev/tests/integration/testsuite/Magento/GraphQl/App/GraphQlStateTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ public function testCartState(
122122
*
123123
* @return array[]
124124
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
125+
* @SuppressWarnings(PHPMD.UnusedPrivateMethod)
125126
*/
126127
private function queryDataProvider(): array
127128
{

dev/tests/integration/testsuite/Magento/GraphQl/App/State/GraphQlStateDiff.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,21 @@ class GraphQlStateDiff
3737
/**
3838
* @var ObjectManagerInterface
3939
*
40-
* @SuppressWarnings(PHPCS)
40+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
4141
*/
4242
private readonly ObjectManagerInterface $objectManagerBeforeTest;
4343

4444
/**
4545
* @var ObjectManager
4646
*
47-
* @SuppressWarnings(PHPCS)
47+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
4848
*/
4949
private readonly ObjectManager $objectManagerForTest;
5050

5151
/**
5252
* @var Comparator
5353
*
54-
* @SuppressWarnings(PHPCS)
54+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
5555
*/
5656
private readonly Comparator $comparator;
5757

@@ -80,6 +80,8 @@ public function getTestObjectManager()
8080
}
8181

8282
/**
83+
* Tear Down
84+
*
8385
* @return void
8486
*/
8587
public function tearDown(): void

lib/internal/Magento/Framework/App/Cache/State.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22
/**
3-
* An ultimate accessor to cache types' statuses
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
@@ -25,12 +23,13 @@ class State implements StateInterface, ResetAfterRequestInterface
2523
/**
2624
* Deployment config key
2725
*/
28-
const CACHE_KEY = 'cache_types';
26+
public const CACHE_KEY = 'cache_types';
2927

3028
/**
3129
* Deployment configuration
3230
*
3331
* @var DeploymentConfig
32+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
3433
*/
3534
private readonly DeploymentConfig $config;
3635

@@ -39,23 +38,22 @@ class State implements StateInterface, ResetAfterRequestInterface
3938
*
4039
* @var Writer
4140
*
42-
* @SuppressWarnings(PHPCS)
41+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
4342
*/
4443
private readonly Writer $writer;
4544

4645
/**
4746
* Associative array of cache type codes and their statuses (enabled/disabled)
4847
*
4948
* @var array|null
50-
* @SuppressWarnings(PHPCS)
5149
*/
5250
private ?array $statuses = null;
5351

5452
/**
5553
* Whether all cache types are forced to be disabled
5654
*
5755
* @var bool
58-
* @SuppressWarnings(PHPCS)
56+
* phpcs:disable Magento2.Commenting.ClassPropertyPHPDocFormatting
5957
*/
6058
private readonly bool $banAll;
6159

lib/internal/Magento/Framework/TestFramework/ApplicationStateComparator/Collector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ function ($element) use (
8989
* @param string $shouldResetState
9090
* @return CollectedObject[]
9191
* @throws \Exception
92-
* @SuppressWarnings(PHPCS)
9392
*/
9493
public function getSharedObjects(string $shouldResetState): array
9594
{
@@ -98,6 +97,7 @@ public function getSharedObjects(string $shouldResetState): array
9897
} else {
9998
$obj = new \ReflectionObject($this->objectManager);
10099
if (!$obj->hasProperty('_sharedInstances')) {
100+
// phpcs:ignore Magento2.Exceptions.DirectThrow
101101
throw new \Exception('Cannot get shared objects from ' . get_class($this->objectManager));
102102
}
103103
$property = $obj->getProperty('_sharedInstances');
@@ -129,13 +129,13 @@ public function getSharedObjects(string $shouldResetState): array
129129
*
130130
* @return CollectedObjectConstructedAndCurrent[]
131131
* @throws \Exception
132-
* @SuppressWarnings(PHPCS)
133132
*/
134133
public function getPropertiesConstructedAndCurrent(): array
135134
{
136135
/** @var ObjectManager $objectManager */
137136
$objectManager = $this->objectManager;
138137
if (!($objectManager instanceof StateObjectManagerInterface)) {
138+
// phpcs:ignore Magento2.Exceptions.DirectThrow
139139
throw new \Exception("Not the correct type of ObjectManager");
140140
}
141141
// Calling _resetState helps us avoid adding skip/filter for these classes.

lib/internal/Magento/Framework/TestFramework/ApplicationStateComparator/Comparator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ private function formatValue($value): mixed
232232
* @return array
233233
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
234234
* @throws \Exception
235-
* @SuppressWarnings(PHPCS)
236235
*/
237236
public function checkValues(mixed $before, mixed $after, array $skipList): array
238237
{
@@ -289,6 +288,7 @@ public function checkValues(mixed $before, mixed $after, array $skipList): array
289288
$skipList,
290289
);
291290
}
291+
// phpcs:ignore Magento2.Exceptions.DirectThrow
292292
throw new \Exception("Unexpected object in checkValues()");
293293
}
294294
return [];

lib/internal/Magento/Framework/TestFramework/ApplicationStateComparator/ObjectManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616
*/
1717
class ObjectManager extends TestFrameworkObjectManager implements ObjectManagerInterface
1818
{
19+
//phpcs:disable Magento2.PHP.LiteralNamespaces
1920
/**
20-
* Constructs this instance by copying test framework's ObjectManager
21-
*
22-
* @param TestFrameworkObjectManager $testFrameworkObjectManager
23-
* @SuppressWarnings(PHPCS)
21+
* @var array|string[]
2422
*/
2523
private array $bootstrappedObjects = [
2624
// Note: These are after $objectManager = $this->_factory->create($overriddenParams);
@@ -97,6 +95,8 @@ class ObjectManager extends TestFrameworkObjectManager implements ObjectManagerI
9795
];
9896

9997
/**
98+
* Constructs this instance by copying test framework's ObjectManager
99+
*
100100
* @param TestFrameworkObjectManager $testFrameworkObjectManager
101101
*/
102102
public function __construct(TestFrameworkObjectManager $testFrameworkObjectManager)

0 commit comments

Comments
 (0)