Fixed phpstan level 2 issues in Framework

This commit is contained in:
Matias Griese 2021-12-07 13:20:57 +02:00
parent f3789bb17e
commit 2165743810
2 changed files with 5 additions and 3 deletions

View File

@ -1054,7 +1054,9 @@ class FlexDirectory implements FlexDirectoryInterface
$newKey = $object->getStorageKey();
if ($oldKey !== $newKey) {
$object->triggerEvent('move');
if (method_exists($object, 'triggerEvent')) {
$object->triggerEvent('move');
}
$storage->renameRow($oldKey, $newKey);
// TODO: media support.
}

View File

@ -191,7 +191,6 @@ class FlexPageCollection extends FlexCollection
$keys = $collection->getStorageKeys();
// Assign next free order.
/** @var FlexPageObject|null $last */
$last = null;
$order = 0;
foreach ($keys as $folder => $key) {
@ -203,8 +202,9 @@ class FlexPageCollection extends FlexCollection
}
}
/** @var FlexPageObject|null $last */
$last = $collection[$last];
return sprintf('%d.', $last ? $last->value('order') + 1 : 1);
return sprintf('%d.', $last ? $last->getFormValue('order') + 1 : 1);
}
}