mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-19 16:10:00 +00:00
Various PSR12 code cleanup
This commit is contained in:
@@ -32,7 +32,7 @@ use FireflyIII\Models\ObjectGroup;
|
||||
trait CreatesObjectGroups
|
||||
{
|
||||
/**
|
||||
* @param int $groupId
|
||||
* @param int $groupId
|
||||
*
|
||||
* @return ObjectGroup|null
|
||||
*/
|
||||
@@ -42,7 +42,7 @@ trait CreatesObjectGroups
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
* @param string $title
|
||||
*
|
||||
* @return ObjectGroup|null
|
||||
*/
|
||||
@@ -67,11 +67,11 @@ trait CreatesObjectGroups
|
||||
*/
|
||||
protected function getObjectGroupMaxOrder(): int
|
||||
{
|
||||
return (int) $this->user->objectGroups()->max('order');
|
||||
return (int)$this->user->objectGroups()->max('order');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
* @param string $title
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
@@ -81,7 +81,7 @@ trait CreatesObjectGroups
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $title
|
||||
* @param string $title
|
||||
*
|
||||
* @return null|ObjectGroup
|
||||
*/
|
||||
|
||||
@@ -118,7 +118,7 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
|
||||
$index = 1;
|
||||
/** @var ObjectGroup $objectGroup */
|
||||
foreach ($list as $objectGroup) {
|
||||
if ($index !== (int) $objectGroup->order) {
|
||||
if ($index !== (int)$objectGroup->order) {
|
||||
Log::debug(
|
||||
sprintf('objectGroup #%d ("%s"): order should %d be but is %d.', $objectGroup->id, $objectGroup->title, $index, $objectGroup->order)
|
||||
);
|
||||
@@ -130,8 +130,8 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
@@ -151,7 +151,7 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param User $user
|
||||
*/
|
||||
public function setUser(User $user): void
|
||||
{
|
||||
@@ -168,7 +168,7 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
|
||||
}
|
||||
|
||||
if (array_key_exists('order', $data)) {
|
||||
$this->setOrder($objectGroup, (int) $data['order']);
|
||||
$this->setOrder($objectGroup, (int)$data['order']);
|
||||
}
|
||||
|
||||
$objectGroup->save();
|
||||
@@ -181,7 +181,7 @@ class ObjectGroupRepository implements ObjectGroupRepositoryInterface
|
||||
*/
|
||||
public function setOrder(ObjectGroup $objectGroup, int $newOrder): ObjectGroup
|
||||
{
|
||||
$oldOrder = (int) $objectGroup->order;
|
||||
$oldOrder = (int)$objectGroup->order;
|
||||
|
||||
if ($newOrder > $oldOrder) {
|
||||
$this->user->objectGroups()->where('object_groups.order', '<=', $newOrder)->where('object_groups.order', '>', $oldOrder)
|
||||
|
||||
@@ -44,7 +44,7 @@ interface ObjectGroupRepositoryInterface
|
||||
public function deleteEmpty(): void;
|
||||
|
||||
/**
|
||||
* @param ObjectGroup $objectGroup
|
||||
* @param ObjectGroup $objectGroup
|
||||
*/
|
||||
public function destroy(ObjectGroup $objectGroup): void;
|
||||
|
||||
@@ -54,14 +54,14 @@ interface ObjectGroupRepositoryInterface
|
||||
public function get(): Collection;
|
||||
|
||||
/**
|
||||
* @param ObjectGroup $objectGroup
|
||||
* @param ObjectGroup $objectGroup
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function getBills(ObjectGroup $objectGroup): Collection;
|
||||
|
||||
/**
|
||||
* @param ObjectGroup $objectGroup
|
||||
* @param ObjectGroup $objectGroup
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
@@ -73,29 +73,29 @@ interface ObjectGroupRepositoryInterface
|
||||
public function resetOrder(): void;
|
||||
|
||||
/**
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function search(string $query, int $limit): Collection;
|
||||
|
||||
/**
|
||||
* @param ObjectGroup $objectGroup
|
||||
* @param int $newOrder
|
||||
* @param ObjectGroup $objectGroup
|
||||
* @param int $newOrder
|
||||
*
|
||||
* @return ObjectGroup
|
||||
*/
|
||||
public function setOrder(ObjectGroup $objectGroup, int $newOrder): ObjectGroup;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
* @param User $user
|
||||
*/
|
||||
public function setUser(User $user): void;
|
||||
|
||||
/**
|
||||
* @param ObjectGroup $objectGroup
|
||||
* @param array $data
|
||||
* @param ObjectGroup $objectGroup
|
||||
* @param array $data
|
||||
*
|
||||
* @return ObjectGroup
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user