Code cleanup.

This commit is contained in:
James Cole
2018-04-02 14:42:07 +02:00
parent f96f38b172
commit 7d02d0f762
55 changed files with 200 additions and 281 deletions

View File

@@ -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;
}
}