Skip to content

Commit 5622a66

Browse files
Merge pull request #16 from magento-amigos/2.4-develop-prs-patch-5
[Amigos] Community Contributions 2.4-develop - Patch 5
2 parents e212168 + b9bdcbd commit 5622a66

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

lib/internal/Magento/Framework/Profiler/Driver/Standard/Stat.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,10 @@ protected function _getOrderedTimerIds()
218218
while (strpos($timerId, $prevTimerId . Profiler::NESTING_SEPARATOR) !== 0) {
219219
/* Add to result all timers nested in the previous timer */
220220
for ($j = $i + 1; $j < $numberTimerIds; $j++) {
221-
if (isset($timerIds[$j]) &&
222-
strpos($timerIds[$j], $prevTimerId . Profiler::NESTING_SEPARATOR) === 0) {
221+
if (!$timerIds[$j]) {
222+
continue;
223+
}
224+
if (strpos($timerIds[$j], $prevTimerId . Profiler::NESTING_SEPARATOR) === 0) {
223225
$result[] = $timerIds[$j];
224226
/* Mark timer as already added */
225227
$timerIds[$j] = null;

lib/internal/Magento/Framework/Profiler/Test/Unit/Driver/Standard/StatTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php declare(strict_types=1);
22
/**
3-
* Test class for \Magento\Framework\Profiler\Driver\Standard\Stat
4-
*
53
* Copyright © Magento, Inc. All rights reserved.
64
* See COPYING.txt for license details.
75
*/
@@ -238,13 +236,24 @@ public function timersSortingDataProvider()
238236
['start', 'root'],
239237
['start', 'root->init'],
240238
['start', 'root->system'],
239+
['start', 'root->system->init_config'],
240+
['stop', 'root->system->init_config'],
241+
['start', 'root->system->init_store'],
242+
['stop', 'root->system->init_store'],
241243
['stop', 'root->system'],
242244
['start', 'root->init->init_config'],
243245
['stop', 'root->init->init_config'],
244246
['stop', 'root->init'],
245247
['stop', 'root'],
246248
],
247-
'expected' => ['root', 'root->init', 'root->init->init_config', 'root->system'],
249+
'expected' => [
250+
'root',
251+
'root->init',
252+
'root->init->init_config',
253+
'root->system',
254+
'root->system->init_config',
255+
'root->system->init_store',
256+
],
248257
]
249258
];
250259
}

0 commit comments

Comments
 (0)