mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 12:12:18 +00:00
Code cleanup.
This commit is contained in:
@@ -44,8 +44,8 @@ class BudgetFactory
|
||||
*/
|
||||
public function find(?int $budgetId, ?string $budgetName): ?Budget
|
||||
{
|
||||
$budgetId = intval($budgetId);
|
||||
$budgetName = strval($budgetName);
|
||||
$budgetId = (int)$budgetId;
|
||||
$budgetName = (string)$budgetName;
|
||||
|
||||
if (strlen($budgetName) === 0 && $budgetId === 0) {
|
||||
return null;
|
||||
@@ -55,14 +55,14 @@ class BudgetFactory
|
||||
if ($budgetId > 0) {
|
||||
/** @var Budget $budget */
|
||||
$budget = $this->user->budgets()->find($budgetId);
|
||||
if (!is_null($budget)) {
|
||||
if (null !== $budget) {
|
||||
return $budget;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($budgetName) > 0) {
|
||||
$budget = $this->findByName($budgetName);
|
||||
if (!is_null($budget)) {
|
||||
if (null !== $budget) {
|
||||
return $budget;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user