mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Fixed phpstan level 2 issues in Framework
This commit is contained in:
parent
f3789bb17e
commit
2165743810
|
|
@ -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.
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user