Skip to content

Firefly III: a personal finances manager

Some code cleanup courtesy of phpstorm.

James Cole97727e2e3d94
diff --git a/app/Helpers/Csv/Converter/Date.php b/app/Helpers/Csv/Converter/Date.php
index d43a961ac1..fa6a6a8cb4 100644
--- a/app/Helpers/Csv/Converter/Date.php
+++ b/app/Helpers/Csv/Converter/Date.php
@@ -17,7 +17,8 @@ class Date extends BasicConverter implements ConverterInterface
{
/**
- * @return Carbon
+ * @return static
+ * @throws FireflyException
*/
public function convert()
{
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index ab7993255d..b7a6c4c006 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -56,7 +56,8 @@ class AccountController extends Controller
}
/**
- * @param Account $account
+ * @param AccountRepositoryInterface $repository
+ * @param Account $account
*
* @return \Illuminate\View\View
*/
diff --git a/app/Http/Controllers/AttachmentController.php b/app/Http/Controllers/AttachmentController.php
index ac255e3783..5a750ac786 100644
--- a/app/Http/Controllers/AttachmentController.php
+++ b/app/Http/Controllers/AttachmentController.php
@@ -90,7 +90,8 @@ class AttachmentController extends Controller
}
/**
- * @param Attachment $attachment
+ * @param Attachment $attachment
+ * @param AttachmentHelperInterface $helper
*/
public function download(Attachment $attachment, AttachmentHelperInterface $helper)
{
diff --git a/app/Http/Controllers/Auth/AuthController.php b/app/Http/Controllers/Auth/AuthController.php
index 1ea0a985df..ab6e06a35e 100644
--- a/app/Http/Controllers/Auth/AuthController.php
+++ b/app/Http/Controllers/Auth/AuthController.php
@@ -228,6 +228,11 @@ class AuthController extends Controller
return $domains;
}
+ /**
+ * @param $email
+ *
+ * @return bool
+ */
protected function isBlockedDomain($email)
{
$parts = explode('@', $email);
diff --git a/app/Http/Controllers/Auth/PasswordController.php b/app/Http/Controllers/Auth/PasswordController.php
index a366bd395a..93eda589b0 100644
--- a/app/Http/Controllers/Auth/PasswordController.php
+++ b/app/Http/Controllers/Auth/PasswordController.php
@@ -77,6 +77,8 @@ class PasswordController extends Controller
return redirect()->back()->withErrors(['email' => trans($response)]);
}
+ abort(404);
+ return '';
}
}
diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php
index 2bece914ec..6e92369b22 100644
--- a/app/Http/Controllers/BudgetController.php
+++ b/app/Http/Controllers/BudgetController.php
@@ -132,7 +132,9 @@ class BudgetController extends Controller
}
/**
- * @param BudgetRepositoryInterface $repository
+ * @param BudgetRepositoryInterface $repository
+ *
+ * @param AccountRepositoryInterface $accountRepository
*
* @return \Illuminate\View\View
*/
diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php
index 0c9ae93f15..04ef878492 100644
--- a/app/Http/Controllers/CategoryController.php
+++ b/app/Http/Controllers/CategoryController.php
@@ -146,6 +146,8 @@ class CategoryController extends Controller
* @param CategoryRepositoryInterface $repository
* @param Category $category
*
+ * @param $date
+ *
* @return \Illuminate\View\View
*/
public function showWithDate(CategoryRepositoryInterface $repository, Category $category, $date)
diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php
index 2ffcf552fe..8d854c474b 100644
--- a/app/Http/Controllers/Chart/BudgetController.php
+++ b/app/Http/Controllers/Chart/BudgetController.php
@@ -43,6 +43,8 @@ class BudgetController extends Controller
* @param Carbon $end
* @param Collection $accounts
* @param Collection $budgets
+ *
+ * @return \Illuminate\Http\JsonResponse
*/
public function multiYear(BudgetRepositoryInterface $repository, $report_type, Carbon $start, Carbon $end, Collection $accounts, Collection $budgets)
{
@@ -110,8 +112,9 @@ class BudgetController extends Controller
}
/**
- * @param BudgetRepositoryInterface $repository
- * @param Budget $budget
+ * @param BudgetRepositoryInterface $repository
+ * @param AccountRepositoryInterface $accountRepository
+ * @param Budget $budget
*
* @return \Symfony\Component\HttpFoundation\Response
*/
@@ -205,7 +208,9 @@ class BudgetController extends Controller
/**
* Shows a budget list with spent/left/overspent.
*
- * @param BudgetRepositoryInterface $repository
+ * @param BudgetRepositoryInterface $repository
+ *
+ * @param AccountRepositoryInterface $accountRepository
*
* @return \Symfony\Component\HttpFoundation\Response
*/
diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php
index 6d97762f22..6511dd92ac 100644
--- a/app/Http/Controllers/Chart/CategoryController.php
+++ b/app/Http/Controllers/Chart/CategoryController.php
@@ -135,6 +135,8 @@ class CategoryController extends Controller
* @param Carbon $end
* @param Collection $accounts
* @param Collection $categories
+ *
+ * @return \Illuminate\Http\JsonResponse
*/
public function multiYear(CategoryRepositoryInterface $repository, $report_type, Carbon $start, Carbon $end, Collection $accounts, Collection $categories)
{
@@ -248,6 +250,8 @@ class CategoryController extends Controller
* @param CategoryRepositoryInterface $repository
* @param Category $category
*
+ * @param $date
+ *
* @return \Symfony\Component\HttpFoundation\Response
*/
public function specificPeriod(CategoryRepositoryInterface $repository, Category $category, $date)
diff --git a/app/Http/Controllers/CsvController.php b/app/Http/Controllers/CsvController.php
index 7b1e0c67a8..e3c864ce85 100644
--- a/app/Http/Controllers/CsvController.php
+++ b/app/Http/Controllers/CsvController.php
@@ -146,6 +146,8 @@ class CsvController extends Controller
*
* STEP ONE
*
+ * @param AccountRepositoryInterface $repository
+ *
* @return \Illuminate\View\View
*/
public function index(AccountRepositoryInterface $repository)
diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php
index 6a1350487b..69e05d06d3 100644
--- a/app/Http/Controllers/JsonController.php
+++ b/app/Http/Controllers/JsonController.php
@@ -89,10 +89,11 @@ class JsonController extends Controller
}
/**
- * @param BillRepositoryInterface $repository
- * @param AccountRepositoryInterface $accountRepository
+ * @param BillRepositoryInterface $repository
*
* @return \Symfony\Component\HttpFoundation\Response
+ * @internal param AccountRepositoryInterface $accountRepository
+ *
*/
public function boxBillsUnpaid(BillRepositoryInterface $repository)
{
@@ -114,7 +115,9 @@ class JsonController extends Controller
}
/**
- * @param ReportQueryInterface $reportQuery
+ * @param ReportQueryInterface $reportQuery
+ *
+ * @param AccountRepositoryInterface $accountRepository
*
* @return \Symfony\Component\HttpFoundation\Response
*/
@@ -141,7 +144,9 @@ class JsonController extends Controller
}
/**
- * @param ReportQueryInterface $reportQuery
+ * @param ReportQueryInterface $reportQuery
+ *
+ * @param AccountRepositoryInterface $accountRepository
*
* @return \Symfony\Component\HttpFoundation\Response
*/
diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php
index bbe78ce268..ccf47d7e4a 100644
--- a/app/Http/Controllers/ReportController.php
+++ b/app/Http/Controllers/ReportController.php
@@ -157,6 +157,14 @@ class ReportController extends Controller
);
}
+ /**
+ * @param $report_type
+ * @param $start
+ * @param $end
+ * @param $accounts
+ *
+ * @return View
+ */
public function defaultMultiYear($report_type, $start, $end, $accounts)
{
diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php
index ca55b40914..8db37205bd 100644
--- a/app/Http/Controllers/TransactionController.php
+++ b/app/Http/Controllers/TransactionController.php
@@ -292,6 +292,8 @@ class TransactionController extends Controller
* @param JournalFormRequest $request
* @param JournalRepositoryInterface $repository
*
+ * @param AttachmentHelperInterface $att
+ *
* @return \Illuminate\Http\RedirectResponse
*/
public function store(JournalFormRequest $request, JournalRepositoryInterface $repository, AttachmentHelperInterface $att)
diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php
index cdb679124b..bf8eb047af 100644
--- a/app/Repositories/Category/CategoryRepository.php
+++ b/app/Repositories/Category/CategoryRepository.php
@@ -399,11 +399,14 @@ class CategoryRepository extends ComponentRepository implements CategoryReposito
return $sum;
}
+
/**
* @param Category $category
* @param int $page
+ * @param Carbon $start
+ * @param Carbon $end
*
- * @return Collection
+ * @return mixed
*/
public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end)
{
@@ -424,6 +427,9 @@ class CategoryRepository extends ComponentRepository implements CategoryReposito
/**
* @param Category $category
*
+ * @param Carbon $start
+ * @param Carbon $end
+ *
* @return int
*/
public function countJournalsInRange(Category $category, Carbon $start, Carbon $end)
diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php
index 3b68cfa76d..34553e7ea3 100644
--- a/app/Repositories/Category/CategoryRepositoryInterface.php
+++ b/app/Repositories/Category/CategoryRepositoryInterface.php
@@ -23,6 +23,9 @@ interface CategoryRepositoryInterface
/**
* @param Category $category
*
+ * @param Carbon $start
+ * @param Carbon $end
+ *
* @return int
*/
public function countJournalsInRange(Category $category, Carbon $start, Carbon $end);
@@ -141,6 +144,9 @@ interface CategoryRepositoryInterface
* @param Category $category
* @param int $page
*
+ * @param Carbon $start
+ * @param Carbon $end
+ *
* @return Collection
*/
public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end);
diff --git a/app/Support/Steam.php b/app/Support/Steam.php
index 8a1118ac6f..4b711f18e3 100644
--- a/app/Support/Steam.php
+++ b/app/Support/Steam.php
@@ -76,10 +76,11 @@ class Steam
* Gets the balance for the given account during the whole range, using this format:
*
* [yyyy-mm-dd] => 123,2
- *
* @param Account $account
* @param Carbon $start
* @param Carbon $end
+ *
+ * @return array
*/
public function balanceInRange(Account $account, Carbon $start, Carbon $end)
{