Expand documentation for Helper directory.

This commit is contained in:
James Cole
2018-07-07 23:14:16 +02:00
parent 8e08ff2d39
commit 10492e3b2f
30 changed files with 328 additions and 51 deletions

View File

@@ -45,7 +45,7 @@ use Steam;
*/
class MetaPieChart implements MetaPieChartInterface
{
/** @var array */
/** @var array The ways to group transactions, given the type of chart. */
static protected $grouping
= [
'account' => ['opposing_account_id'],
@@ -53,17 +53,17 @@ class MetaPieChart implements MetaPieChartInterface
'category' => ['transaction_journal_category_id', 'transaction_category_id'],
'tag' => [],
];
/** @var Collection */
/** @var Collection Involved accounts. */
protected $accounts;
/** @var Collection */
/** @var Collection The budgets. */
protected $budgets;
/** @var Collection */
/** @var Collection The categories. */
protected $categories;
/** @var bool */
/** @var bool Collect other objects. */
protected $collectOtherObjects = false;
/** @var Carbon */
/** @var Carbon The end date./ */
protected $end;
/** @var array */
/** @var array The repositories. */
protected $repositories
= [
'account' => AccountRepositoryInterface::class,
@@ -71,13 +71,13 @@ class MetaPieChart implements MetaPieChartInterface
'category' => CategoryRepositoryInterface::class,
'tag' => TagRepositoryInterface::class,
];
/** @var Carbon */
/** @var Carbon The start date. */
protected $start;
/** @var Collection */
/** @var Collection The involved tags/ */
protected $tags;
/** @var string */
/** @var string The total amount. */
protected $total = '0';
/** @var User */
/** @var User The user. */
protected $user;
/**
@@ -92,6 +92,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Generate the chart.
*
* @param string $direction
* @param string $group
*
@@ -134,6 +136,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Accounts setter.
*
* @codeCoverageIgnore
*
* @param Collection $accounts
@@ -148,6 +152,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Budgets setter.
*
* @codeCoverageIgnore
*
* @param Collection $budgets
@@ -162,6 +168,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Categories setter.
*
* @codeCoverageIgnore
*
* @param Collection $categories
@@ -176,6 +184,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Set if other objects should be collected.
*
* @codeCoverageIgnore
*
* @param bool $collectOtherObjects
@@ -190,6 +200,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Set the end date.
*
* @codeCoverageIgnore
*
* @param Carbon $end
@@ -204,6 +216,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Set the start date.
*
* @codeCoverageIgnore
*
* @param Carbon $start
@@ -218,6 +232,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Set the tags.
*
* @codeCoverageIgnore
*
* @param Collection $tags
@@ -232,6 +248,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Set the user.
*
* @codeCoverageIgnore
*
* @param User $user
@@ -246,6 +264,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Get all transactions.
*
* @param string $direction
*
* @return Collection
@@ -289,6 +309,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Group by a specific field.
*
* @param Collection $set
* @param array $fields
*
@@ -323,6 +345,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Organise by certain type.
*
* @param string $type
* @param array $array
*
@@ -348,6 +372,8 @@ class MetaPieChart implements MetaPieChartInterface
}
/**
* Group by tag (slightly different).
*
* @codeCoverageIgnore
*
* @param Collection $set

View File

@@ -32,6 +32,8 @@ use Illuminate\Support\Collection;
interface MetaPieChartInterface
{
/**
* Generate a chart.
*
* @param string $direction
* @param string $group
*
@@ -40,6 +42,8 @@ interface MetaPieChartInterface
public function generate(string $direction, string $group): array;
/**
* Accounts setter.
*
* @param Collection $accounts
*
* @return MetaPieChartInterface
@@ -47,6 +51,8 @@ interface MetaPieChartInterface
public function setAccounts(Collection $accounts): MetaPieChartInterface;
/**
* Budgets setter.
*
* @param Collection $budgets
*
* @return MetaPieChartInterface
@@ -54,6 +60,8 @@ interface MetaPieChartInterface
public function setBudgets(Collection $budgets): MetaPieChartInterface;
/**
* Categories setter.
*
* @param Collection $categories
*
* @return MetaPieChartInterface
@@ -61,6 +69,8 @@ interface MetaPieChartInterface
public function setCategories(Collection $categories): MetaPieChartInterface;
/**
* Set if other objects should be collected.
*
* @param bool $collectOtherObjects
*
* @return MetaPieChartInterface
@@ -68,6 +78,8 @@ interface MetaPieChartInterface
public function setCollectOtherObjects(bool $collectOtherObjects): MetaPieChartInterface;
/**
* Set the end date.
*
* @param Carbon $end
*
* @return MetaPieChartInterface
@@ -75,6 +87,8 @@ interface MetaPieChartInterface
public function setEnd(Carbon $end): MetaPieChartInterface;
/**
* Set the start date.
*
* @param Carbon $start
*
* @return MetaPieChartInterface
@@ -82,6 +96,8 @@ interface MetaPieChartInterface
public function setStart(Carbon $start): MetaPieChartInterface;
/**
* Set the tags.
*
* @param Collection $tags
*
* @return MetaPieChartInterface
@@ -89,6 +105,8 @@ interface MetaPieChartInterface
public function setTags(Collection $tags): MetaPieChartInterface;
/**
* Set the user.
*
* @param User $user
*
* @return MetaPieChartInterface

View File

@@ -29,14 +29,14 @@ use Illuminate\Support\Collection;
*/
class Balance
{
/** @var BalanceHeader */
/** @var BalanceHeader Header row. */
protected $balanceHeader;
/** @var Collection */
/** @var Collection Collection of lines. */
protected $balanceLines;
/**
*
* Balance constructor.
*/
public function __construct()
{
@@ -44,6 +44,8 @@ class Balance
}
/**
* Add a line.
*
* @param BalanceLine $line
*/
public function addBalanceLine(BalanceLine $line): void
@@ -52,6 +54,8 @@ class Balance
}
/**
* Get the header.
*
* @return BalanceHeader
*/
public function getBalanceHeader(): BalanceHeader
@@ -60,6 +64,8 @@ class Balance
}
/**
* Set the header.
*
* @param BalanceHeader $balanceHeader
*/
public function setBalanceHeader(BalanceHeader $balanceHeader): void
@@ -68,6 +74,8 @@ class Balance
}
/**
* Get all lines.
*
* @return Collection
*/
public function getBalanceLines(): Collection
@@ -76,6 +84,8 @@ class Balance
}
/**
* Set all lines.
*
* @param Collection $balanceLines
*/
public function setBalanceLines(Collection $balanceLines): void

View File

@@ -29,14 +29,16 @@ use FireflyIII\Models\Account as AccountModel;
*/
class BalanceEntry
{
/** @var AccountModel */
/** @var AccountModel The account. */
protected $account;
/** @var string */
/** @var string The amount left. */
protected $left = '0';
/** @var string */
/** @var string The amount spent. */
protected $spent = '0';
/**
* Account getter.
*
* @return AccountModel
*/
public function getAccount(): AccountModel
@@ -45,6 +47,8 @@ class BalanceEntry
}
/**
* Account setter.
*
* @param AccountModel $account
*/
public function setAccount(AccountModel $account): void
@@ -53,6 +57,8 @@ class BalanceEntry
}
/**
* Get amount left.
*
* @return string
*/
public function getLeft(): string
@@ -61,6 +67,8 @@ class BalanceEntry
}
/**
* Set amount left.
*
* @param string $left
*/
public function setLeft(string $left): void
@@ -69,6 +77,8 @@ class BalanceEntry
}
/**
* Get amount spent.
*
* @return string
*/
public function getSpent(): string
@@ -77,6 +87,8 @@ class BalanceEntry
}
/**
* Set amount spent.
*
* @param string $spent
*/
public function setSpent(string $spent): void

View File

@@ -30,11 +30,11 @@ use Illuminate\Support\Collection;
*/
class BalanceHeader
{
/** @var Collection */
/** @var Collection The accounts. */
protected $accounts;
/**
*
* BalanceHeader constructor.
*/
public function __construct()
{
@@ -42,6 +42,8 @@ class BalanceHeader
}
/**
* Add an account.
*
* @param AccountModel $account
*/
public function addAccount(AccountModel $account): void
@@ -50,6 +52,8 @@ class BalanceHeader
}
/**
* Get them all.
*
* @return Collection
*/
public function getAccounts(): Collection

View File

@@ -32,17 +32,15 @@ use Log;
*/
class Bill
{
/**
* @var Collection
*/
/** @var Collection The bills. */
private $bills;
/** @var Carbon */
/** @var Carbon End date of the collection. */
private $endDate;
/** @var Carbon */
/** @var Carbon Start date of the collection. */
private $startDate;
/**
*
* Bill constructor.
*/
public function __construct()
{
@@ -50,6 +48,8 @@ class Bill
}
/**
* Add a bill line.
*
* @param BillLine $bill
*/
public function addBill(BillLine $bill): void
@@ -58,7 +58,7 @@ class Bill
}
/**
*
* Filter the bills (yes how very descriptive).
*/
public function filterBills(): void
{
@@ -95,6 +95,8 @@ class Bill
}
/**
* Bills getter.
*
* @return Collection
*/
public function getBills(): Collection
@@ -112,6 +114,8 @@ class Bill
}
/**
* End date setter.
*
* @param Carbon $endDate
*/
public function setEndDate(Carbon $endDate): void
@@ -120,6 +124,8 @@ class Bill
}
/**
* Start date setter.
*
* @param Carbon $startDate
*/
public function setStartDate(Carbon $startDate): void

View File

@@ -30,23 +30,23 @@ use FireflyIII\Models\Bill as BillModel;
*/
class BillLine
{
/** @var string */
/** @var string The amount */
protected $amount;
/** @var BillModel */
/** @var BillModel The bill. */
protected $bill;
/** @var bool */
/** @var bool Is it hit this period */
protected $hit;
/** @var string */
/** @var string What was the max amount. */
protected $max;
/** @var string */
/** @var string What was the min amount. */
protected $min;
/** @var Carbon */
/** @var Carbon Latest date that payment is expected. */
private $endOfPayDate;
/** @var Carbon */
/** @var Carbon Date of last hit */
private $lastHitDate;
/** @var Carbon */
/** @var Carbon Date of last payment */
private $payDate;
/** @var int */
/** @var int Journal */
private $transactionJournalId;
/**
@@ -58,6 +58,8 @@ class BillLine
}
/**
* Amount getter.
*
* @return string
*/
public function getAmount(): string
@@ -66,6 +68,8 @@ class BillLine
}
/**
* Amount setter.
*
* @param string $amount
*/
public function setAmount(string $amount): void
@@ -74,6 +78,8 @@ class BillLine
}
/**
* Bill getter.
*
* @return BillModel
*/
public function getBill(): BillModel
@@ -82,6 +88,8 @@ class BillLine
}
/**
* Bill setter.
*
* @param BillModel $bill
*/
public function setBill(BillModel $bill): void
@@ -90,6 +98,8 @@ class BillLine
}
/**
* End of pay date getter.
*
* @return Carbon
*/
public function getEndOfPayDate(): Carbon
@@ -98,6 +108,8 @@ class BillLine
}
/**
* End of pay date setter.
*
* @param Carbon $endOfPayDate
*/
public function setEndOfPayDate(Carbon $endOfPayDate): void
@@ -106,6 +118,8 @@ class BillLine
}
/**
* Last hit date getter.
*
* @return Carbon
*/
public function getLastHitDate(): Carbon
@@ -114,6 +128,8 @@ class BillLine
}
/**
* Last hit date setter.
*
* @param Carbon $lastHitDate
*/
public function setLastHitDate(Carbon $lastHitDate): void
@@ -122,6 +138,8 @@ class BillLine
}
/**
* Max getter.
*
* @return string
*/
public function getMax(): string
@@ -130,6 +148,8 @@ class BillLine
}
/**
* Max setter.
*
* @param string $max
*/
public function setMax(string $max): void
@@ -138,6 +158,8 @@ class BillLine
}
/**
* Min getter.
*
* @return string
*/
public function getMin(): string
@@ -146,6 +168,8 @@ class BillLine
}
/**
* Min setter.
*
* @param string $min
*/
public function setMin(string $min): void
@@ -154,6 +178,8 @@ class BillLine
}
/**
* Pay date getter.
*
* @return Carbon
*/
public function getPayDate(): Carbon
@@ -162,6 +188,8 @@ class BillLine
}
/**
* Pay date setter.
*
* @param Carbon $payDate
*/
public function setPayDate(Carbon $payDate): void
@@ -170,6 +198,8 @@ class BillLine
}
/**
* Journal ID getter.
*
* @return int
*/
public function getTransactionJournalId(): int
@@ -178,6 +208,8 @@ class BillLine
}
/**
* Journal ID setter.
*
* @param int $transactionJournalId
*/
public function setTransactionJournalId(int $transactionJournalId): void
@@ -186,6 +218,8 @@ class BillLine
}
/**
* Is active.
*
* @return bool
*/
public function isActive(): bool
@@ -194,6 +228,8 @@ class BillLine
}
/**
* Is hit.
*
* @return bool
*/
public function isHit(): bool
@@ -202,6 +238,8 @@ class BillLine
}
/**
* Set is hit.
*
* @param bool $hit
*/
public function setHit(bool $hit): void

View File

@@ -30,13 +30,13 @@ use Illuminate\Support\Collection;
*/
class Category
{
/** @var Collection */
/** @var Collection The categories */
protected $categories;
/** @var string */
/** @var string Total amount */
protected $total = '0';
/**
*
* Category constructor.
*/
public function __construct()
{
@@ -44,6 +44,8 @@ class Category
}
/**
* Add a category.
*
* @param CategoryModel $category
*/
public function addCategory(CategoryModel $category): void
@@ -56,6 +58,8 @@ class Category
}
/**
* Add to the total amount.
*
* @param string $add
*/
public function addTotal(string $add): void
@@ -64,6 +68,8 @@ class Category
}
/**
* Get all categories.
*
* @return Collection
*/
public function getCategories(): Collection
@@ -78,6 +84,8 @@ class Category
}
/**
* Get the total.
*
* @return string
*/
public function getTotal(): string

View File

@@ -38,6 +38,8 @@ interface JournalCollectorInterface
{
/**
* Add a specific filter.
*
* @param string $filter
*
* @return JournalCollectorInterface
@@ -45,6 +47,8 @@ interface JournalCollectorInterface
public function addFilter(string $filter): JournalCollectorInterface;
/**
* Get transactions with a specific amount.
*
* @param string $amount
*
* @return JournalCollectorInterface
@@ -52,6 +56,8 @@ interface JournalCollectorInterface
public function amountIs(string $amount): JournalCollectorInterface;
/**
* Get transactions where the amount is less than.
*
* @param string $amount
*
* @return JournalCollectorInterface
@@ -59,6 +65,8 @@ interface JournalCollectorInterface
public function amountLess(string $amount): JournalCollectorInterface;
/**
* Get transactions where the amount is more than.
*
* @param string $amount
*
* @return JournalCollectorInterface
@@ -66,31 +74,44 @@ interface JournalCollectorInterface
public function amountMore(string $amount): JournalCollectorInterface;
/**
* Count the result.
*
* @return int
*/
public function count(): int;
/**
* Get all journals.
* TODO rename me.
*
* @return Collection
*/
public function getJournals(): Collection;
/**
* Get a paginated result.
*
* @return LengthAwarePaginator
*/
public function getPaginatedJournals(): LengthAwarePaginator;
/**
* Get the query.
*
* @return EloquentBuilder
*/
public function getQuery(): EloquentBuilder;
/**
* Set to ignore the cache.
*
* @return JournalCollectorInterface
*/
public function ignoreCache(): JournalCollectorInterface;
/**
* Remove a filter.
*
* @param string $filter
*
* @return JournalCollectorInterface
@@ -98,6 +119,8 @@ interface JournalCollectorInterface
public function removeFilter(string $filter): JournalCollectorInterface;
/**
* Set the accounts to collect from.
*
* @param Collection $accounts
*
* @return JournalCollectorInterface
@@ -105,6 +128,8 @@ interface JournalCollectorInterface
public function setAccounts(Collection $accounts): JournalCollectorInterface;
/**
* Collect journals after a specific date.
*
* @param Carbon $after
*
* @return JournalCollectorInterface
@@ -112,11 +137,15 @@ interface JournalCollectorInterface
public function setAfter(Carbon $after): JournalCollectorInterface;
/**
* Include all asset accounts.
*
* @return JournalCollectorInterface
*/
public function setAllAssetAccounts(): JournalCollectorInterface;
/**
* Collect journals before a specific date.
*
* @param Carbon $before
*
* @return JournalCollectorInterface
@@ -124,6 +153,8 @@ interface JournalCollectorInterface
public function setBefore(Carbon $before): JournalCollectorInterface;
/**
* Set the bills to filter on.
*
* @param Collection $bills
*
* @return JournalCollectorInterface
@@ -131,6 +162,8 @@ interface JournalCollectorInterface
public function setBills(Collection $bills): JournalCollectorInterface;
/**
* Set the budget to filter on.
*
* @param Budget $budget
*
* @return JournalCollectorInterface
@@ -138,6 +171,8 @@ interface JournalCollectorInterface
public function setBudget(Budget $budget): JournalCollectorInterface;
/**
* Set the budgets to filter on.
*
* @param Collection $budgets
*
* @return JournalCollectorInterface
@@ -145,6 +180,8 @@ interface JournalCollectorInterface
public function setBudgets(Collection $budgets): JournalCollectorInterface;
/**
* Set the categories to filter on.
*
* @param Collection $categories
*
* @return JournalCollectorInterface
@@ -152,6 +189,8 @@ interface JournalCollectorInterface
public function setCategories(Collection $categories): JournalCollectorInterface;
/**
* Set the category to filter on.
*
* @param Category $category
*
* @return JournalCollectorInterface
@@ -159,6 +198,8 @@ interface JournalCollectorInterface
public function setCategory(Category $category): JournalCollectorInterface;
/**
* Set the journals to filter on.
*
* @param Collection $journals
*
* @return JournalCollectorInterface
@@ -166,6 +207,8 @@ interface JournalCollectorInterface
public function setJournals(Collection $journals): JournalCollectorInterface;
/**
* Set the page limit.
*
* @param int $limit
*
* @return JournalCollectorInterface
@@ -173,6 +216,8 @@ interface JournalCollectorInterface
public function setLimit(int $limit): JournalCollectorInterface;
/**
* Set the offset.
*
* @param int $offset
*
* @return JournalCollectorInterface
@@ -180,6 +225,8 @@ interface JournalCollectorInterface
public function setOffset(int $offset): JournalCollectorInterface;
/**
* Set the opposing accounts to collect from.
*
* @param Collection $accounts
*
* @return JournalCollectorInterface
@@ -187,6 +234,8 @@ interface JournalCollectorInterface
public function setOpposingAccounts(Collection $accounts): JournalCollectorInterface;
/**
* Set the page to get.
*
* @param int $page
*
* @return JournalCollectorInterface
@@ -194,6 +243,8 @@ interface JournalCollectorInterface
public function setPage(int $page): JournalCollectorInterface;
/**
* Set the date range.
*
* @param Carbon $start
* @param Carbon $end
*
@@ -202,6 +253,8 @@ interface JournalCollectorInterface
public function setRange(Carbon $start, Carbon $end): JournalCollectorInterface;
/**
* Set the tag to collect from.
*
* @param Tag $tag
*
* @return JournalCollectorInterface
@@ -209,6 +262,8 @@ interface JournalCollectorInterface
public function setTag(Tag $tag): JournalCollectorInterface;
/**
* Set the tags to collect from.
*
* @param Collection $tags
*
* @return JournalCollectorInterface
@@ -216,6 +271,8 @@ interface JournalCollectorInterface
public function setTags(Collection $tags): JournalCollectorInterface;
/**
* Set the types to collect.
*
* @param array $types
*
* @return JournalCollectorInterface
@@ -223,6 +280,8 @@ interface JournalCollectorInterface
public function setTypes(array $types): JournalCollectorInterface;
/**
* Set the user.
*
* @param User $user
*
* @return mixed
@@ -230,31 +289,41 @@ interface JournalCollectorInterface
public function setUser(User $user);
/**
*
* Start the query.
*/
public function startQuery();
/**
* Include budget information.
*
* @return JournalCollectorInterface
*/
public function withBudgetInformation(): JournalCollectorInterface;
/**
* Include category information.
*
* @return JournalCollectorInterface
*/
public function withCategoryInformation(): JournalCollectorInterface;
/**
* Include opposing account information.
*
* @return JournalCollectorInterface
*/
public function withOpposingAccount(): JournalCollectorInterface;
/**
* Include tranactions without a budget.
*
* @return JournalCollectorInterface
*/
public function withoutBudget(): JournalCollectorInterface;
/**
* Include tranactions without a category.
*
* @return JournalCollectorInterface
*/
public function withoutCategory(): JournalCollectorInterface;

View File

@@ -34,7 +34,7 @@ use Log;
*/
class AmountFilter implements FilterInterface
{
/** @var int */
/** @var int Either -1 or +1 for the filter. */
private $modifier;
/**
@@ -48,6 +48,8 @@ class AmountFilter implements FilterInterface
}
/**
* Filter on amount.
*
* @param Collection $set
*
* @return Collection

View File

@@ -36,6 +36,8 @@ class CountAttachmentsFilter implements FilterInterface
{
/**
* Adds the number of transactions to each given transaction.
*
* @param Collection $set
*
* @return Collection

View File

@@ -30,6 +30,8 @@ use Illuminate\Support\Collection;
class EmptyFilter implements FilterInterface
{
/**
* Simply returns the set.
*
* @param Collection $set
*
* @return Collection

View File

@@ -30,6 +30,8 @@ use Illuminate\Support\Collection;
interface FilterInterface
{
/**
* Apply the filter.
*
* @param Collection $set
*
* @return Collection

View File

@@ -35,7 +35,7 @@ use Log;
*/
class InternalTransferFilter implements FilterInterface
{
/** @var array */
/** @var array The accounts */
private $accounts;
/**
@@ -49,6 +49,8 @@ class InternalTransferFilter implements FilterInterface
}
/**
* See class description.
*
* @param Collection $set
*
* @return Collection

View File

@@ -34,6 +34,8 @@ use Log;
class NegativeAmountFilter implements FilterInterface
{
/**
* See class description.
*
* @param Collection $set
*
* @return Collection

View File

@@ -34,7 +34,7 @@ use Log;
*/
class OpposingAccountFilter implements FilterInterface
{
/** @var array */
/** @var array The asset accounts. */
private $accounts;
/**
@@ -48,6 +48,8 @@ class OpposingAccountFilter implements FilterInterface
}
/**
* Only return specific transactions. See class description.
*
* @param Collection $set
*
* @return Collection

View File

@@ -37,6 +37,8 @@ use Log;
class PositiveAmountFilter implements FilterInterface
{
/**
* See class description.
*
* @param Collection $set
*
* @return Collection

View File

@@ -35,6 +35,8 @@ class SplitIndicatorFilter implements FilterInterface
{
/**
* Adds a property if the journal is a split one.
*
* @param Collection $set
*
* @return Collection

View File

@@ -39,6 +39,8 @@ use Log;
class TransactionViewFilter implements FilterInterface
{
/**
* See class description.
*
* @param Collection $set
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @return Collection

View File

@@ -35,6 +35,8 @@ use Steam;
class TransferFilter implements FilterInterface
{
/**
* See class transaction.
*
* @param Collection $set
*
* @return Collection

View File

@@ -35,14 +35,14 @@ use Route;
*/
class Help implements HelpInterface
{
/**
*
*/
/** @var string The cache key */
public const CACHEKEY = 'help_%s_%s';
/** @var string */
/** @var string The user agent. */
protected $userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36';
/**
* Get from cache.
*
* @param string $route
* @param string $language
*
@@ -56,12 +56,14 @@ class Help implements HelpInterface
}
/**
* Get text from GitHub.
*
* @param string $route
* @param string $language
*
* @return string
*/
public function getFromGithub(string $route, string $language): string
public function getFromGitHub(string $route, string $language): string
{
$uri = sprintf('https://raw.githubusercontent.com/firefly-iii/help/master/%s/%s.md', $language, $route);
Log::debug(sprintf('Trying to get %s...', $uri));
@@ -89,6 +91,8 @@ class Help implements HelpInterface
}
/**
* Do we have the route?
*
* @param string $route
*
* @return bool
@@ -99,6 +103,8 @@ class Help implements HelpInterface
}
/**
* Is in cache?
*
* @param string $route
* @param string $language
*
@@ -119,6 +125,8 @@ class Help implements HelpInterface
}
/**
* Put help text in cache.
*
* @param string $route
* @param string $language
* @param string $content

View File

@@ -28,6 +28,8 @@ namespace FireflyIII\Helpers\Help;
interface HelpInterface
{
/**
* Get the help text from cache.
*
* @param string $route
* @param string $language
*
@@ -36,14 +38,18 @@ interface HelpInterface
public function getFromCache(string $route, string $language): string;
/**
* Get the help text from GitHub.
*
* @param string $route
* @param string $language
*
* @return string
*/
public function getFromGithub(string $route, string $language): string;
public function getFromGitHub(string $route, string $language): string;
/**
* Is the route a known route?
*
* @param string $route
*
* @return bool
@@ -51,6 +57,8 @@ interface HelpInterface
public function hasRoute(string $route): bool;
/**
* Is the help text in cache?
*
* @param string $route
* @param string $language
*
@@ -59,6 +67,8 @@ interface HelpInterface
public function inCache(string $route, string $language): bool;
/**
* Put the result in cache.
*
* @param string $route
* @param string $language
* @param string $content

View File

@@ -37,7 +37,7 @@ use Log;
*/
class BalanceReportHelper implements BalanceReportHelperInterface
{
/** @var BudgetRepositoryInterface */
/** @var BudgetRepositoryInterface Budget repository */
protected $budgetRepository;
/**
@@ -52,6 +52,8 @@ class BalanceReportHelper implements BalanceReportHelperInterface
}
/**
* Generate a balance report.
*
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
@@ -91,6 +93,8 @@ class BalanceReportHelper implements BalanceReportHelperInterface
}
/**
* Create one balance line.
*
* @param BudgetLimit $budgetLimit
* @param Collection $accounts
*
@@ -120,6 +124,8 @@ class BalanceReportHelper implements BalanceReportHelperInterface
}
/**
* Create a line for transactions without a budget.
*
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
@@ -143,6 +149,8 @@ class BalanceReportHelper implements BalanceReportHelperInterface
}
/**
* Remove unused budgets from the report.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @param Balance $balance
*

View File

@@ -32,6 +32,8 @@ use Illuminate\Support\Collection;
interface BalanceReportHelperInterface
{
/**
* Generates the report (duh).
*
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end

View File

@@ -33,7 +33,7 @@ use Illuminate\Support\Collection;
*/
class BudgetReportHelper implements BudgetReportHelperInterface
{
/** @var BudgetRepositoryInterface */
/** @var BudgetRepositoryInterface The budget repository interface. */
private $repository;
/**
@@ -47,6 +47,8 @@ class BudgetReportHelper implements BudgetReportHelperInterface
}
/**
* Get the full budget report.
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @param Carbon $start
@@ -112,6 +114,8 @@ class BudgetReportHelper implements BudgetReportHelperInterface
}
/**
* Get all budgets and the expenses in these budgets.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
@@ -142,6 +146,7 @@ class BudgetReportHelper implements BudgetReportHelperInterface
}
/**
* Calculate the expenses for a budget.
* @param Budget $budget
* @param BudgetLimit $budgetLimit
* @param Collection $accounts

View File

@@ -31,6 +31,8 @@ use Illuminate\Support\Collection;
interface BudgetReportHelperInterface
{
/**
* Generates the budget report.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
@@ -40,6 +42,8 @@ interface BudgetReportHelperInterface
public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): array;
/**
* Get budgets and the expenses in each budget.
*
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts

View File

@@ -37,6 +37,8 @@ use Illuminate\Support\Collection;
class PopupReport implements PopupReportInterface
{
/**
* Collect the tranactions for one account and one budget.
*
* @param Budget $budget
* @param Account $account
* @param array $attributes
@@ -53,6 +55,8 @@ class PopupReport implements PopupReportInterface
}
/**
* Collect the tranactions for one account and no budget.
*
* @param Account $account
* @param array $attributes
*
@@ -72,6 +76,8 @@ class PopupReport implements PopupReportInterface
}
/**
* Collect the tranactions for a budget.
*
* @param Budget $budget
* @param array $attributes
*
@@ -95,6 +101,8 @@ class PopupReport implements PopupReportInterface
}
/**
* Collect journals by a category.
*
* @param Category $category
* @param array $attributes
*
@@ -112,6 +120,8 @@ class PopupReport implements PopupReportInterface
}
/**
* Group transactions by expense.
*
* @param Account $account
* @param array $attributes
*
@@ -147,6 +157,8 @@ class PopupReport implements PopupReportInterface
}
/**
* Collect transactions by income.
*
* @param Account $account
* @param array $attributes
*

View File

@@ -33,6 +33,8 @@ use Illuminate\Support\Collection;
interface PopupReportInterface
{
/**
* Get balances for budget.
*
* @param Budget $budget
* @param Account $account
* @param array $attributes
@@ -42,6 +44,8 @@ interface PopupReportInterface
public function balanceForBudget(Budget $budget, Account $account, array $attributes): Collection;
/**
* Get balances for transactions without a budget.
*
* @param Account $account
* @param array $attributes
*
@@ -50,6 +54,7 @@ interface PopupReportInterface
public function balanceForNoBudget(Account $account, array $attributes): Collection;
/**
* Group by budget.
* @param Budget $budget
* @param array $attributes
*
@@ -58,6 +63,8 @@ interface PopupReportInterface
public function byBudget(Budget $budget, array $attributes): Collection;
/**
* Group by category.
*
* @param Category $category
* @param array $attributes
*
@@ -66,6 +73,8 @@ interface PopupReportInterface
public function byCategory(Category $category, array $attributes): Collection;
/**
* Do something with expense. Sorry, I am not very inspirational here.
*
* @param Account $account
* @param array $attributes
*
@@ -74,6 +83,8 @@ interface PopupReportInterface
public function byExpenses(Account $account, array $attributes): Collection;
/**
* Do something with income. Sorry, I am not very inspirational here.
*
* @param Account $account
* @param array $attributes
*

View File

@@ -38,7 +38,7 @@ use Illuminate\Support\Collection;
*/
class ReportHelper implements ReportHelperInterface
{
/** @var BudgetRepositoryInterface */
/** @var BudgetRepositoryInterface The budget repository */
protected $budgetRepository;
/**
@@ -118,6 +118,8 @@ class ReportHelper implements ReportHelperInterface
}
/**
* Generate a list of months for the report.
*
* @param Carbon $date
*
* @return array

View File

@@ -46,6 +46,8 @@ interface ReportHelperInterface
public function getBillReport(Carbon $start, Carbon $end, Collection $accounts): BillCollection;
/**
* Generate a list of months.
*
* @param Carbon $date
*
* @return array