Skip to content

Commit 4638f97

Browse files
committed
AC-2855: Fixed failing Static test cases
1 parent 3cc7e87 commit 4638f97

File tree

4 files changed

+88
-28
lines changed

4 files changed

+88
-28
lines changed

app/code/Magento/Backend/Model/Menu.php

Lines changed: 76 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -321,134 +321,192 @@ public function populateFromArray(array $data)
321321

322322
// Need to override and suppress return type deprecation warnings for php8 compatibility
323323

324-
#[\ReturnTypeWillChange]
325-
public function offsetExists($key)
324+
/**
325+
* @inheritDoc
326+
* phpcs:disable Generic.CodeAnalysis.UselessOverridingMethod
327+
*/
328+
public function offsetExists($key): bool
326329
{
327330
return parent::offsetExists($key);
328331
}
329332

333+
/**
334+
* @inheritDoc
335+
*/
330336
#[\ReturnTypeWillChange]
331337
public function offsetGet($key)
332338
{
333339
return parent::offsetGet($key);
334340
}
335341

342+
/**
343+
* @inheritDoc
344+
*/
336345
#[\ReturnTypeWillChange]
337346
public function offsetSet($key, $value)
338347
{
339348
parent::offsetSet($key, $value);
340349
}
341350

351+
/**
352+
* @inheritDoc
353+
*/
342354
#[\ReturnTypeWillChange]
343355
public function offsetUnset($key)
344356
{
345357
parent::offsetUnset($key);
346358
}
347359

348-
#[\ReturnTypeWillChange]
349-
public function count()
360+
/**
361+
* @inheritDoc
362+
*/
363+
public function count(): int
350364
{
351365
return parent::count();
352366
}
353367

368+
/**
369+
* @inheritDoc
370+
*/
354371
#[\ReturnTypeWillChange]
355372
public function append($value)
356373
{
357374
parent::append($value);
358375
}
359376

360-
#[\ReturnTypeWillChange]
361-
public function getArrayCopy()
377+
/**
378+
* @inheritDoc
379+
*/
380+
public function getArrayCopy(): array
362381
{
363382
return parent::getArrayCopy();
364383
}
365384

366-
#[\ReturnTypeWillChange]
367-
public function getFlags()
385+
/**
386+
* @inheritDoc
387+
*/
388+
public function getFlags(): int
368389
{
369390
return parent::getFlags();
370391
}
371392

393+
/**
394+
* @inheritDoc
395+
*/
372396
#[\ReturnTypeWillChange]
373397
public function setFlags($flags)
374398
{
375399
parent::setFlags($flags);
376400
}
377401

402+
/**
403+
* @inheritDoc
404+
*/
378405
#[\ReturnTypeWillChange]
379406
public function asort($flags = SORT_REGULAR)
380407
{
381408
parent::asort($flags);
382409
}
383410

411+
/**
412+
* @inheritDoc
413+
*/
384414
#[\ReturnTypeWillChange]
385415
public function ksort($flags = SORT_REGULAR)
386416
{
387417
parent::ksort($flags);
388418
}
389419

420+
/**
421+
* @inheritDoc
422+
*/
390423
#[\ReturnTypeWillChange]
391424
public function uasort($callback)
392425
{
393426
parent::uasort($callback);
394427
}
395428

429+
/**
430+
* @inheritDoc
431+
*/
396432
#[\ReturnTypeWillChange]
397433
public function uksort($callback)
398434
{
399435
parent::uksort($callback);
400436
}
401437

402-
#[\ReturnTypeWillChange]
403-
public function exchangeArray($array)
438+
/**
439+
* @inheritDoc
440+
*/
441+
public function exchangeArray($array): array
404442
{
405443
return parent::exchangeArray($array);
406444
}
407445

446+
/**
447+
* @inheritDoc
448+
*/
408449
#[\ReturnTypeWillChange]
409450
public function setIteratorClass($iteratorClass)
410451
{
411452
parent::setIteratorClass($iteratorClass);
412453
}
413454

455+
/**
456+
* @inheritDoc
457+
*/
414458
#[\ReturnTypeWillChange]
415459
public function natsort()
416460
{
417461
parent::natsort();
418462
}
419463

464+
/**
465+
* @inheritDoc
466+
*/
420467
#[\ReturnTypeWillChange]
421468
public function natcasesort()
422469
{
423470
parent::natcasesort();
424471
}
425472

426-
#[\ReturnTypeWillChange]
427-
public function __serialize()
473+
/**
474+
* @inheritDoc
475+
*/
476+
public function __serialize(): array
428477
{
429478
return parent::__serialize();
430479
}
431480

481+
/**
482+
* @inheritDoc
483+
*/
432484
#[\ReturnTypeWillChange]
433485
public function __unserialize(array $data)
434486
{
435487
parent::__unserialize($data);
436488
}
437489

438-
#[\ReturnTypeWillChange]
439-
public function getIterator()
490+
/**
491+
* @inheritDoc
492+
*/
493+
public function getIterator(): \ArrayIterator
440494
{
441495
return parent::getIterator();
442496
}
443497

444-
#[\ReturnTypeWillChange]
445-
public function getIteratorClass()
498+
/**
499+
* @inheritDoc
500+
*/
501+
public function getIteratorClass(): string
446502
{
447503
return parent::getIteratorClass();
448504
}
449505

450-
#[\ReturnTypeWillChange]
451-
public function __debugInfo()
506+
/**
507+
* @inheritDoc
508+
*/
509+
public function __debugInfo(): array
452510
{
453511
return parent::__debugInfo();
454512
}

lib/internal/Magento/Framework/Code/Generator/EntityAbstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class EntityAbstract
1818
/**
1919
* Entity type abstract
2020
*/
21-
const ENTITY_TYPE = 'abstract';
21+
public const ENTITY_TYPE = 'abstract';
2222

2323
/**
2424
* @var string[]

lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/SampleBackendMenu.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
declare(strict_types=1);
7+
68
namespace Magento\Framework\Interception\Code\Generator;
79

810
use Magento\Backend\Model\Menu;

lib/internal/Magento/Framework/Interception/Test/Unit/Code/Generator/_files/SampleBackendMenuInterceptor.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
124124
/**
125125
* {@inheritdoc}
126126
*/
127-
public function offsetExists($key)
127+
public function offsetExists($key) : bool
128128
{
129129
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'offsetExists');
130130
return $pluginInfo ? $this->___callPlugins('offsetExists', func_get_args(), $pluginInfo) : parent::offsetExists($key);
@@ -160,7 +160,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
160160
/**
161161
* {@inheritdoc}
162162
*/
163-
public function count()
163+
public function count() : int
164164
{
165165
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'count');
166166
return $pluginInfo ? $this->___callPlugins('count', func_get_args(), $pluginInfo) : parent::count();
@@ -178,7 +178,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
178178
/**
179179
* {@inheritdoc}
180180
*/
181-
public function getArrayCopy()
181+
public function getArrayCopy() : array
182182
{
183183
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getArrayCopy');
184184
return $pluginInfo ? $this->___callPlugins('getArrayCopy', func_get_args(), $pluginInfo) : parent::getArrayCopy();
@@ -187,7 +187,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
187187
/**
188188
* {@inheritdoc}
189189
*/
190-
public function getFlags()
190+
public function getFlags() : int
191191
{
192192
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getFlags');
193193
return $pluginInfo ? $this->___callPlugins('getFlags', func_get_args(), $pluginInfo) : parent::getFlags();
@@ -241,7 +241,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
241241
/**
242242
* {@inheritdoc}
243243
*/
244-
public function exchangeArray($array)
244+
public function exchangeArray($array) : array
245245
{
246246
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'exchangeArray');
247247
return $pluginInfo ? $this->___callPlugins('exchangeArray', func_get_args(), $pluginInfo) : parent::exchangeArray($array);
@@ -277,7 +277,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
277277
/**
278278
* {@inheritdoc}
279279
*/
280-
public function __serialize()
280+
public function __serialize() : array
281281
{
282282
$pluginInfo = $this->pluginList->getNext($this->subjectType, '__serialize');
283283
return $pluginInfo ? $this->___callPlugins('__serialize', func_get_args(), $pluginInfo) : parent::__serialize();
@@ -295,7 +295,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
295295
/**
296296
* {@inheritdoc}
297297
*/
298-
public function getIterator()
298+
public function getIterator() : \ArrayIterator
299299
{
300300
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getIterator');
301301
return $pluginInfo ? $this->___callPlugins('getIterator', func_get_args(), $pluginInfo) : parent::getIterator();
@@ -304,7 +304,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
304304
/**
305305
* {@inheritdoc}
306306
*/
307-
public function getIteratorClass()
307+
public function getIteratorClass() : string
308308
{
309309
$pluginInfo = $this->pluginList->getNext($this->subjectType, 'getIteratorClass');
310310
return $pluginInfo ? $this->___callPlugins('getIteratorClass', func_get_args(), $pluginInfo) : parent::getIteratorClass();
@@ -313,7 +313,7 @@ class Interceptor extends \Magento\Framework\Interception\Code\Generator\SampleB
313313
/**
314314
* {@inheritdoc}
315315
*/
316-
public function __debugInfo()
316+
public function __debugInfo() : array
317317
{
318318
$pluginInfo = $this->pluginList->getNext($this->subjectType, '__debugInfo');
319319
return $pluginInfo ? $this->___callPlugins('__debugInfo', func_get_args(), $pluginInfo) : parent::__debugInfo();

0 commit comments

Comments
 (0)