Expand tests, do code cleanup.

This commit is contained in:
James Cole
2017-12-17 14:30:53 +01:00
parent b08af77c98
commit 78335e5814
141 changed files with 773 additions and 54 deletions

View File

@@ -72,6 +72,7 @@ class AccountRepository implements AccountRepositoryInterface
* @param Account $moveTo
*
* @return bool
* @throws \Exception
*/
public function destroy(Account $account, Account $moveTo): bool
{
@@ -239,6 +240,8 @@ class AccountRepository implements AccountRepositoryInterface
/**
* @param Account $account
*
* @throws \Exception
*/
protected function deleteInitialBalance(Account $account)
{
@@ -410,6 +413,7 @@ class AccountRepository implements AccountRepositoryInterface
* @param string $name
*
* @return Account
* @throws FireflyException
*/
protected function storeOpposingAccount(string $name): Account
{
@@ -507,6 +511,7 @@ class AccountRepository implements AccountRepositoryInterface
* @param array $data
*
* @return bool
* @throws \Exception
*/
protected function updateOpeningBalanceJournal(Account $account, TransactionJournal $journal, array $data): bool
{

View File

@@ -211,6 +211,7 @@ trait FindAccountsTrait
/**
* @return Account
* @throws FireflyException
*/
public function getCashAccount(): Account
{

View File

@@ -43,6 +43,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
* @param Attachment $attachment
*
* @return bool
* @throws \Exception
*/
public function destroy(Attachment $attachment): bool
{
@@ -129,6 +130,7 @@ class AttachmentRepository implements AttachmentRepositoryInterface
* @param Attachment $attachment
*
* @return string
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function getContent(Attachment $attachment): string
{

View File

@@ -48,6 +48,7 @@ class BillRepository implements BillRepositoryInterface
* @param Bill $bill
*
* @return bool
* @throws \Exception
*/
public function destroy(Bill $bill): bool
{
@@ -390,6 +391,8 @@ class BillRepository implements BillRepositoryInterface
* @param Carbon $date
*
* @return \Carbon\Carbon
* @throws \FireflyIII\Support\Facades\FireflyException
* @throws \FireflyIII\Support\Facades\FireflyException
*/
public function nextDateMatch(Bill $bill, Carbon $date): Carbon
{
@@ -427,6 +430,9 @@ class BillRepository implements BillRepositoryInterface
* @param Carbon $date
*
* @return Carbon
* @throws \FireflyIII\Support\Facades\FireflyException
* @throws \FireflyIII\Support\Facades\FireflyException
* @throws \FireflyIII\Support\Facades\FireflyException
*/
public function nextExpectedMatch(Bill $bill, Carbon $date): Carbon
{

View File

@@ -51,6 +51,8 @@ class BudgetRepository implements BudgetRepositoryInterface
/**
* @return bool
* @throws \Exception
* @throws \Exception
*/
public function cleanupBudgets(): bool
{
@@ -123,6 +125,7 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param Budget $budget
*
* @return bool
* @throws \Exception
*/
public function destroy(Budget $budget): bool
{
@@ -604,6 +607,7 @@ class BudgetRepository implements BudgetRepositoryInterface
* @param string $amount
*
* @return BudgetLimit
* @throws \Exception
*/
public function updateLimitAmount(Budget $budget, Carbon $start, Carbon $end, string $amount): BudgetLimit
{

View File

@@ -44,6 +44,7 @@ class CategoryRepository implements CategoryRepositoryInterface
* @param Category $category
*
* @return bool
* @throws \Exception
*/
public function destroy(Category $category): bool
{

View File

@@ -53,6 +53,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface
/**
* @return bool
* @throws \Exception
*/
public function cleanup(): bool
{
@@ -137,6 +138,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface
* @param ExportJob $job
*
* @return string
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
*/
public function getContent(ExportJob $job): string
{

View File

@@ -99,6 +99,7 @@ class JournalRepository implements JournalRepositoryInterface
* @param TransactionJournal $journal
*
* @return bool
* @throws \Exception
*/
public function delete(TransactionJournal $journal): bool
{
@@ -273,6 +274,8 @@ class JournalRepository implements JournalRepositoryInterface
* @param array $data
*
* @return TransactionJournal
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function store(array $data): TransactionJournal
{
@@ -358,6 +361,10 @@ class JournalRepository implements JournalRepositoryInterface
* @param array $data
*
* @return TransactionJournal
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException
* @throws \FireflyIII\Exceptions\FireflyException
*/
public function update(TransactionJournal $journal, array $data): TransactionJournal
{

View File

@@ -119,6 +119,8 @@ trait SupportJournalsTrait
* @param array $data
*
* @return array
* @throws FireflyException
* @throws FireflyException
*/
protected function storeDepositAccounts(User $user, array $data): array
{
@@ -165,6 +167,8 @@ trait SupportJournalsTrait
* @param array $data
*
* @return array
* @throws FireflyException
* @throws FireflyException
*/
protected function storeWithdrawalAccounts(User $user, array $data): array
{

View File

@@ -51,6 +51,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
* @param LinkType $moveTo
*
* @return bool
* @throws \Exception
*/
public function destroy(LinkType $linkType, LinkType $moveTo): bool
{
@@ -66,6 +67,7 @@ class LinkTypeRepository implements LinkTypeRepositoryInterface
* @param TransactionJournalLink $link
*
* @return bool
* @throws \Exception
*/
public function destroyLink(TransactionJournalLink $link): bool
{

View File

@@ -49,6 +49,9 @@ class RuleRepository implements RuleRepositoryInterface
* @param Rule $rule
*
* @return bool
* @throws \Exception
* @throws \Exception
* @throws \Exception
*/
public function destroy(Rule $rule): bool
{

View File

@@ -49,6 +49,8 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
* @param RuleGroup|null $moveTo
*
* @return bool
* @throws \Exception
* @throws \Exception
*/
public function destroy(RuleGroup $ruleGroup, ?RuleGroup $moveTo): bool
{

View File

@@ -74,6 +74,7 @@ class TagRepository implements TagRepositoryInterface
* @param Tag $tag
*
* @return bool
* @throws \Exception
*/
public function destroy(Tag $tag): bool
{

View File

@@ -132,6 +132,7 @@ class UserRepository implements UserRepositoryInterface
* @param User $user
*
* @return bool
* @throws \Exception
*/
public function destroy(User $user): bool
{