Fix phpstan issues.

This commit is contained in:
James Cole
2023-11-05 19:55:39 +01:00
parent 1d2e95f5af
commit 6f6b8d9b3e
33 changed files with 151 additions and 69 deletions

View File

@@ -118,7 +118,7 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
$index = 1;
/** @var ObjectGroup $objectGroup */
foreach ($list as $objectGroup) {
if ($index !== (int)$objectGroup->order) {
if ($index !== $objectGroup->order) {
app('log')->debug(
sprintf('objectGroup #%d ("%s"): order should %d be but is %d.', $objectGroup->id, $objectGroup->title, $index, $objectGroup->order)
);
@@ -183,7 +183,7 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
*/
public function setOrder(ObjectGroup $objectGroup, int $newOrder): ObjectGroup
{
$oldOrder = (int)$objectGroup->order;
$oldOrder = $objectGroup->order;
if ($newOrder > $oldOrder) {
$this->user->objectGroups()->where('object_groups.order', '<=', $newOrder)->where('object_groups.order', '>', $oldOrder)