Skip to content

Commit f029fe3

Browse files
committed
Merge branch 'fix-profiler-php81' of github.com:vovayatsyuk/magento2
2 parents 2e45de7 + 5b7f2e4 commit f029fe3

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,24 @@ public function timersSortingDataProvider()
238238
['start', 'root'],
239239
['start', 'root->init'],
240240
['start', 'root->system'],
241+
['start', 'root->system->init_config'],
242+
['stop', 'root->system->init_config'],
243+
['start', 'root->system->init_store'],
244+
['stop', 'root->system->init_store'],
241245
['stop', 'root->system'],
242246
['start', 'root->init->init_config'],
243247
['stop', 'root->init->init_config'],
244248
['stop', 'root->init'],
245249
['stop', 'root'],
246250
],
247-
'expected' => ['root', 'root->init', 'root->init->init_config', 'root->system'],
251+
'expected' => [
252+
'root',
253+
'root->init',
254+
'root->init->init_config',
255+
'root->system',
256+
'root->system->init_config',
257+
'root->system->init_store',
258+
],
248259
]
249260
];
250261
}

0 commit comments

Comments
 (0)