diff --git a/app/Handlers/Events/AdminEventHandler.php b/app/Handlers/Events/AdminEventHandler.php
index b7f999fe19..79e1cbeb40 100644
--- a/app/Handlers/Events/AdminEventHandler.php
+++ b/app/Handlers/Events/AdminEventHandler.php
@@ -35,6 +35,8 @@ use Swift_TransportException;
class AdminEventHandler
{
/**
+ * Sends a test message to an administrator.
+ *
* @param AdminRequestedTestMessage $event
*
* @return bool
diff --git a/app/Http/Controllers/Account/ReconcileController.php b/app/Http/Controllers/Account/ReconcileController.php
index 518785380f..b5573c83a4 100644
--- a/app/Http/Controllers/Account/ReconcileController.php
+++ b/app/Http/Controllers/Account/ReconcileController.php
@@ -45,6 +45,7 @@ use View;
/**
* Class ReconcileController.
+ * @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ReconcileController extends Controller
{
@@ -100,7 +101,7 @@ class ReconcileController extends Controller
return view(
'accounts.reconcile.edit',
- compact('journal', 'optionalFields', 'assetAccounts', 'what', 'budgetList', 'subTitle')
+ compact('journal', 'subTitle')
)->with('data', $preFilled);
}
@@ -136,8 +137,6 @@ class ReconcileController extends Controller
/** @var Transaction $transaction */
foreach ($transactions as $transaction) {
- // {% if transaction.date > end %}
-
$amount = bcadd($amount, $transaction->amount);
}
@@ -148,24 +147,12 @@ class ReconcileController extends Controller
++$countCleared;
}
}
-
- // final difference:
- //{% set diff = (startBalance - endBalance) + clearedAmount + amount %}
$difference = bcadd(bcadd(bcsub($startBalance, $endBalance), $clearedAmount), $amount);
$diffCompare = bccomp($difference, '0');
-
$return = [
- 'is_zero' => false,
'post_uri' => $route,
- 'html' => '',
+ 'html' => view('accounts.reconcile.overview', compact('account', 'start', 'diffCompare', 'difference', 'end', 'clearedIds', 'transactionIds', 'clearedAmount', 'startBalance', 'endBalance', 'amount', 'route', 'countCleared'))->render(),
];
- $return['html'] = view(
- 'accounts.reconcile.overview',
- compact(
- 'account', 'start', 'diffCompare', 'difference', 'end', 'clearedIds', 'transactionIds', 'clearedAmount', 'startBalance', 'endBalance', 'amount',
- 'route', 'countCleared'
- )
- )->render();
return Response::json($return);
}
@@ -175,7 +162,7 @@ class ReconcileController extends Controller
* @param Carbon|null $start
* @param Carbon|null $end
*
- * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+ * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
*/
public function reconcile(Account $account, Carbon $start = null, Carbon $end = null)
{
@@ -219,28 +206,14 @@ class ReconcileController extends Controller
$overviewUri = route('accounts.reconcile.overview', [$account->id, '%start%', '%end%']);
$indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']);
- return view(
- 'accounts.reconcile.index',
- compact(
- 'account',
- 'currency',
- 'subTitleIcon',
- 'start',
- 'end',
- 'subTitle',
- 'startBalance',
- 'endBalance',
- 'transactionsUri',
- 'selectionStart',
- 'selectionEnd',
- 'overviewUri',
- 'indexUri'
- )
- );
+ return view('accounts.reconcile.index', compact('account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance', 'transactionsUri', 'overviewUri', 'indexUri'));
}
/**
- * @param TransactionJournal $journal
+ * @param JournalRepositoryInterface $repository
+ * @param TransactionJournal $journal
+ *
+ * @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
*/
public function show(JournalRepositoryInterface $repository, TransactionJournal $journal)
{
@@ -257,9 +230,12 @@ class ReconcileController extends Controller
}
/**
+ * @param Request $request
* @param Account $account
* @param Carbon $start
* @param Carbon $end
+ *
+ * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function submit(Request $request, Account $account, Carbon $start, Carbon $end)
{
diff --git a/app/Mail/AdminTestMail.php b/app/Mail/AdminTestMail.php
index a0402718d3..9895359c3b 100644
--- a/app/Mail/AdminTestMail.php
+++ b/app/Mail/AdminTestMail.php
@@ -1,7 +1,4 @@
.
*/
+declare(strict_types=1);
+
+
namespace FireflyIII\Mail;
use Illuminate\Bus\Queueable;
@@ -30,14 +30,16 @@ use Illuminate\Queue\SerializesModels;
/**
* Class AdminTestMail.
+ *
+ * Sends a test mail to administrators.
*/
class AdminTestMail extends Mailable
{
use Queueable, SerializesModels;
- /** @var string */
+ /** @var string Email address of admin */
public $email;
- /** @var string */
+ /** @var string IP address of admin */
public $ipAddress;
/**
diff --git a/app/Mail/ConfirmEmailChangeMail.php b/app/Mail/ConfirmEmailChangeMail.php
index c079c4aac8..d08b62eba5 100644
--- a/app/Mail/ConfirmEmailChangeMail.php
+++ b/app/Mail/ConfirmEmailChangeMail.php
@@ -1,7 +1,4 @@
.
*/
+declare(strict_types=1);
+
namespace FireflyIII\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
+/**
+ * Class ConfirmEmailChangeMail
+ *
+ * Sends message to new address to confirm change.
+ */
class ConfirmEmailChangeMail extends Mailable
{
use Queueable, SerializesModels;
- /** @var string */
+ /** @var string IP address of user */
public $ipAddress;
- /** @var string */
+ /** @var string New email address */
public $newEmail;
- /** @var string */
+ /** @var string Old email address */
public $oldEmail;
- /** @var string */
+ /** @var string Confirmation link */
public $uri;
/**
diff --git a/app/Mail/RegisteredUser.php b/app/Mail/RegisteredUser.php
index ea8914883f..1e01647930 100644
--- a/app/Mail/RegisteredUser.php
+++ b/app/Mail/RegisteredUser.php
@@ -36,12 +36,17 @@ use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
+/**
+ * Sends newly registered user an email message.
+ *
+ * Class RegisteredUser
+ */
class RegisteredUser extends Mailable
{
use Queueable, SerializesModels;
- /** @var string */
+ /** @var string Email address of user */
public $address;
- /** @var string */
+ /** @var string IP address of user */
public $ipAddress;
/**
diff --git a/app/Mail/RequestedNewPassword.php b/app/Mail/RequestedNewPassword.php
index 1d236adb5d..6041424d62 100644
--- a/app/Mail/RequestedNewPassword.php
+++ b/app/Mail/RequestedNewPassword.php
@@ -36,12 +36,16 @@ use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
+/**
+ * Sends user link for new password.
+ * Class RequestedNewPassword
+ */
class RequestedNewPassword extends Mailable
{
use Queueable, SerializesModels;
- /** @var string */
+ /** @var string IP address of user */
public $ipAddress;
- /** @var string */
+ /** @var string URI of password change link */
public $url;
/**
diff --git a/app/Mail/UndoEmailChangeMail.php b/app/Mail/UndoEmailChangeMail.php
index bc20ed3717..6fc85d6e07 100644
--- a/app/Mail/UndoEmailChangeMail.php
+++ b/app/Mail/UndoEmailChangeMail.php
@@ -1,7 +1,4 @@
.
*/
+declare(strict_types=1);
+
+
+
namespace FireflyIII\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
+/**
+ * Class UndoEmailChangeMail
+ */
class UndoEmailChangeMail extends Mailable
{
use Queueable, SerializesModels;
- /** @var string */
+ /** @var string IP address of user*/
public $ipAddress;
- /** @var string */
+ /** @var string New email address */
public $newEmail;
- /** @var string */
+ /** @var string Old email address */
public $oldEmail;
- /** @var string */
+ /** @var string URI to undo */
public $uri;
/**
diff --git a/app/Providers/AccountServiceProvider.php b/app/Providers/AccountServiceProvider.php
index b2d35d3a4c..18c91905fd 100644
--- a/app/Providers/AccountServiceProvider.php
+++ b/app/Providers/AccountServiceProvider.php
@@ -51,7 +51,7 @@ class AccountServiceProvider extends ServiceProvider
}
/**
- *
+ * Register account repository
*/
private function registerRepository()
{
diff --git a/app/Providers/AdminServiceProvider.php b/app/Providers/AdminServiceProvider.php
index e2afa5d433..ff50e60680 100644
--- a/app/Providers/AdminServiceProvider.php
+++ b/app/Providers/AdminServiceProvider.php
@@ -45,7 +45,7 @@ class AdminServiceProvider extends ServiceProvider
}
/**
- *
+ * Register link type repository
*/
private function linkType()
{
diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
index 3522b9cc71..b70d194202 100644
--- a/app/Providers/AuthServiceProvider.php
+++ b/app/Providers/AuthServiceProvider.php
@@ -33,6 +33,9 @@ namespace FireflyIII\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
+/**
+ * Class AuthServiceProvider
+ */
class AuthServiceProvider extends ServiceProvider
{
/**
diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php
index 47075de9df..af54952808 100644
--- a/app/Repositories/Journal/JournalRepositoryInterface.php
+++ b/app/Repositories/Journal/JournalRepositoryInterface.php
@@ -18,6 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see .
*/
+
declare(strict_types=1);
namespace FireflyIII\Repositories\Journal;
diff --git a/app/TransactionRules/Actions/ActionInterface.php b/app/TransactionRules/Actions/ActionInterface.php
index 82a84f0c41..4b8fe556dc 100644
--- a/app/TransactionRules/Actions/ActionInterface.php
+++ b/app/TransactionRules/Actions/ActionInterface.php
@@ -38,6 +38,8 @@ interface ActionInterface
public function __construct(RuleAction $action);
/**
+ * Execute the action.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/AddTag.php b/app/TransactionRules/Actions/AddTag.php
index 6b7109adf5..79514af3a4 100644
--- a/app/TransactionRules/Actions/AddTag.php
+++ b/app/TransactionRules/Actions/AddTag.php
@@ -32,7 +32,7 @@ use Log;
*/
class AddTag implements ActionInterface
{
- /** @var RuleAction */
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -46,6 +46,8 @@ class AddTag implements ActionInterface
}
/**
+ * Add a tag
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/AppendDescription.php b/app/TransactionRules/Actions/AppendDescription.php
index 58b7298f41..1c15703706 100644
--- a/app/TransactionRules/Actions/AppendDescription.php
+++ b/app/TransactionRules/Actions/AppendDescription.php
@@ -31,6 +31,7 @@ use Log;
*/
class AppendDescription implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -44,6 +45,8 @@ class AppendDescription implements ActionInterface
}
/**
+ * Append description with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/AppendNotes.php b/app/TransactionRules/Actions/AppendNotes.php
index 4af78bbe30..bdfb17838d 100644
--- a/app/TransactionRules/Actions/AppendNotes.php
+++ b/app/TransactionRules/Actions/AppendNotes.php
@@ -32,6 +32,7 @@ use Log;
*/
class AppendNotes implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -45,6 +46,8 @@ class AppendNotes implements ActionInterface
}
/**
+ * Append notes with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/ClearBudget.php b/app/TransactionRules/Actions/ClearBudget.php
index bf78f5070c..c824651be1 100644
--- a/app/TransactionRules/Actions/ClearBudget.php
+++ b/app/TransactionRules/Actions/ClearBudget.php
@@ -31,6 +31,7 @@ use Log;
*/
class ClearBudget implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -44,6 +45,8 @@ class ClearBudget implements ActionInterface
}
/**
+ * Clear all budgets
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/ClearCategory.php b/app/TransactionRules/Actions/ClearCategory.php
index c4f5f8dc81..76456d06fd 100644
--- a/app/TransactionRules/Actions/ClearCategory.php
+++ b/app/TransactionRules/Actions/ClearCategory.php
@@ -31,6 +31,7 @@ use Log;
*/
class ClearCategory implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -44,6 +45,8 @@ class ClearCategory implements ActionInterface
}
/**
+ * Clear all categories
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/ClearNotes.php b/app/TransactionRules/Actions/ClearNotes.php
index dd84d16519..0c132687cf 100644
--- a/app/TransactionRules/Actions/ClearNotes.php
+++ b/app/TransactionRules/Actions/ClearNotes.php
@@ -32,6 +32,7 @@ use Log;
*/
class ClearNotes implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -45,6 +46,8 @@ class ClearNotes implements ActionInterface
}
/**
+ * Remove notes
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/PrependDescription.php b/app/TransactionRules/Actions/PrependDescription.php
index fa60c30c3f..bab0c148ef 100644
--- a/app/TransactionRules/Actions/PrependDescription.php
+++ b/app/TransactionRules/Actions/PrependDescription.php
@@ -31,6 +31,7 @@ use Log;
*/
class PrependDescription implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -44,6 +45,8 @@ class PrependDescription implements ActionInterface
}
/**
+ * Prepend description with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/PrependNotes.php b/app/TransactionRules/Actions/PrependNotes.php
index 21b20592c8..30b54ae2fd 100644
--- a/app/TransactionRules/Actions/PrependNotes.php
+++ b/app/TransactionRules/Actions/PrependNotes.php
@@ -32,6 +32,7 @@ use Log;
*/
class PrependNotes implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -45,6 +46,8 @@ class PrependNotes implements ActionInterface
}
/**
+ * Prepend notes with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/RemoveAllTags.php b/app/TransactionRules/Actions/RemoveAllTags.php
index d6efb992e0..f1b506b865 100644
--- a/app/TransactionRules/Actions/RemoveAllTags.php
+++ b/app/TransactionRules/Actions/RemoveAllTags.php
@@ -31,6 +31,7 @@ use Log;
*/
class RemoveAllTags implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -44,6 +45,8 @@ class RemoveAllTags implements ActionInterface
}
/**
+ * Remove all tags
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/RemoveTag.php b/app/TransactionRules/Actions/RemoveTag.php
index 1ddd98d7a0..a5a2f4d616 100644
--- a/app/TransactionRules/Actions/RemoveTag.php
+++ b/app/TransactionRules/Actions/RemoveTag.php
@@ -32,6 +32,7 @@ use Log;
*/
class RemoveTag implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -45,6 +46,8 @@ class RemoveTag implements ActionInterface
}
/**
+ * Remove tag X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/SetBudget.php b/app/TransactionRules/Actions/SetBudget.php
index c9efbb6422..40e93a73d3 100644
--- a/app/TransactionRules/Actions/SetBudget.php
+++ b/app/TransactionRules/Actions/SetBudget.php
@@ -34,6 +34,7 @@ use Log;
*/
class SetBudget implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -47,6 +48,8 @@ class SetBudget implements ActionInterface
}
/**
+ * Set budget X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/SetCategory.php b/app/TransactionRules/Actions/SetCategory.php
index daa3b611dd..09e1bcd3d8 100644
--- a/app/TransactionRules/Actions/SetCategory.php
+++ b/app/TransactionRules/Actions/SetCategory.php
@@ -32,6 +32,7 @@ use Log;
*/
class SetCategory implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -45,6 +46,8 @@ class SetCategory implements ActionInterface
}
/**
+ * Set category X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/SetDescription.php b/app/TransactionRules/Actions/SetDescription.php
index 4face0a53c..1a72105aff 100644
--- a/app/TransactionRules/Actions/SetDescription.php
+++ b/app/TransactionRules/Actions/SetDescription.php
@@ -31,9 +31,11 @@ use Log;
*/
class SetDescription implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
+ *
* TriggerInterface constructor.
*
* @param RuleAction $action
@@ -44,6 +46,8 @@ class SetDescription implements ActionInterface
}
/**
+ * Set description to X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/SetDestinationAccount.php b/app/TransactionRules/Actions/SetDestinationAccount.php
index 75ab0bc67c..933d46b1b4 100644
--- a/app/TransactionRules/Actions/SetDestinationAccount.php
+++ b/app/TransactionRules/Actions/SetDestinationAccount.php
@@ -35,15 +35,16 @@ use Log;
*/
class SetDestinationAccount implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
- /** @var TransactionJournal */
+ /** @var TransactionJournal The journal */
private $journal;
- /** @var Account */
+ /** @var Account The new account */
private $newDestinationAccount;
- /** @var AccountRepositoryInterface */
+ /** @var AccountRepositoryInterface Account repository */
private $repository;
/**
@@ -57,6 +58,7 @@ class SetDestinationAccount implements ActionInterface
}
/**
+ * Set destination account to X
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/SetNotes.php b/app/TransactionRules/Actions/SetNotes.php
index 3b548a9f08..c93419f8a2 100644
--- a/app/TransactionRules/Actions/SetNotes.php
+++ b/app/TransactionRules/Actions/SetNotes.php
@@ -18,6 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see .
*/
+
declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions;
@@ -32,6 +33,7 @@ use Log;
*/
class SetNotes implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
/**
@@ -45,6 +47,8 @@ class SetNotes implements ActionInterface
}
/**
+ * Set notes to X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Actions/SetSourceAccount.php b/app/TransactionRules/Actions/SetSourceAccount.php
index 733c4ba546..4bdb6be100 100644
--- a/app/TransactionRules/Actions/SetSourceAccount.php
+++ b/app/TransactionRules/Actions/SetSourceAccount.php
@@ -18,6 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see .
*/
+
declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions;
@@ -35,15 +36,16 @@ use Log;
*/
class SetSourceAccount implements ActionInterface
{
+ /** @var RuleAction The rule action */
private $action;
- /** @var TransactionJournal */
+ /** @var TransactionJournal The journal */
private $journal;
- /** @var Account */
+ /** @var Account The new source account*/
private $newSourceAccount;
- /** @var AccountRepositoryInterface */
+ /** @var AccountRepositoryInterface Account repository */
private $repository;
/**
@@ -57,6 +59,8 @@ class SetSourceAccount implements ActionInterface
}
/**
+ * Set source account to X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Factory/ActionFactory.php b/app/TransactionRules/Factory/ActionFactory.php
index f45cae70ed..10fa2a5a65 100644
--- a/app/TransactionRules/Factory/ActionFactory.php
+++ b/app/TransactionRules/Factory/ActionFactory.php
@@ -30,10 +30,12 @@ use Log;
/**
* @codeCoverageIgnore
- * Class ActionFactory
+ *
+ * Class ActionFactory can create actions.
*/
class ActionFactory
{
+ /** @var array array of action types */
protected static $actionTypes = [];
/**
diff --git a/app/TransactionRules/Factory/TriggerFactory.php b/app/TransactionRules/Factory/TriggerFactory.php
index 83fc417097..9ce21ec569 100644
--- a/app/TransactionRules/Factory/TriggerFactory.php
+++ b/app/TransactionRules/Factory/TriggerFactory.php
@@ -31,10 +31,12 @@ use Log;
/**
* @codeCoverageIgnore
- * Interface TriggerInterface
+ *
+ * Class TriggerFactory can create triggers.
*/
class TriggerFactory
{
+ /** @var array array with trigger types */
protected static $triggerTypes = [];
/**
diff --git a/app/TransactionRules/Processor.php b/app/TransactionRules/Processor.php
index a880c88910..ad4a3560b7 100644
--- a/app/TransactionRules/Processor.php
+++ b/app/TransactionRules/Processor.php
@@ -39,15 +39,15 @@ use Log;
*/
final class Processor
{
- /** @var Collection */
+ /** @var Collection Actions to exectute */
public $actions;
- /** @var TransactionJournal */
+ /** @var TransactionJournal Journal to run them on */
public $journal;
- /** @var Rule */
+ /** @var Rule Rule that applies */
public $rule;
- /** @var Collection */
+ /** @var Collection All triggers*/
public $triggers;
- /** @var int */
+ /** @var int Found triggers */
private $foundTriggers = 0;
/**
@@ -132,6 +132,8 @@ final class Processor
}
/**
+ * Return found triggers
+ *
* @return int
*/
public function getFoundTriggers(): int
@@ -140,6 +142,8 @@ final class Processor
}
/**
+ * Set found triggers
+ *
* @param int $foundTriggers
*/
public function setFoundTriggers(int $foundTriggers)
@@ -148,6 +152,8 @@ final class Processor
}
/**
+ * Returns the rule
+ *
* @return \FireflyIII\Models\Rule
*/
public function getRule(): Rule
@@ -216,6 +222,8 @@ final class Processor
}
/**
+ * Run the actions
+ *
* @return bool
*/
private function actions()
diff --git a/app/TransactionRules/TransactionMatcher.php b/app/TransactionRules/TransactionMatcher.php
index 82753bd86a..49ef27059b 100644
--- a/app/TransactionRules/TransactionMatcher.php
+++ b/app/TransactionRules/TransactionMatcher.php
@@ -36,15 +36,15 @@ use Log;
*/
class TransactionMatcher
{
- /** @var int */
+ /** @var int Limit of matcher */
private $limit = 10;
/** @var int Maximum number of transaction to search in (for performance reasons) * */
private $range = 200;
- /** @var Rule */
+ /** @var Rule The rule to apply */
private $rule;
- /** @var JournalTaskerInterface */
+ /** @var JournalTaskerInterface Tasker for some related tasks */
private $tasker;
- /** @var array */
+ /** @var array Types that can be matched using this matcher */
private $transactionTypes = [TransactionType::DEPOSIT, TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
/** @var array List of triggers to match */
private $triggers = [];
@@ -108,6 +108,7 @@ class TransactionMatcher
}
/**
+ * Return limit
* @return int
*/
public function getLimit(): int
@@ -116,6 +117,8 @@ class TransactionMatcher
}
/**
+ * Set limit
+ *
* @param int $limit
*
* @return TransactionMatcher
@@ -128,6 +131,7 @@ class TransactionMatcher
}
/**
+ * Get range
* @return int
*/
public function getRange(): int
@@ -136,6 +140,8 @@ class TransactionMatcher
}
/**
+ * Set range
+ *
* @param int $range
*
* @return TransactionMatcher
@@ -148,6 +154,7 @@ class TransactionMatcher
}
/**
+ * Get triggers
* @return array
*/
public function getTriggers(): array
@@ -156,6 +163,8 @@ class TransactionMatcher
}
/**
+ * Set triggers
+ *
* @param array $triggers
*
* @return TransactionMatcher
@@ -168,6 +177,8 @@ class TransactionMatcher
}
/**
+ * Set rule
+ *
* @param Rule $rule
*/
public function setRule(Rule $rule)
@@ -176,6 +187,8 @@ class TransactionMatcher
}
/**
+ * Run the processor.
+ *
* @param Processor $processor
*
* @return Collection
diff --git a/app/TransactionRules/Triggers/AbstractTrigger.php b/app/TransactionRules/Triggers/AbstractTrigger.php
index d6e9b73b30..b6ca47c6ca 100644
--- a/app/TransactionRules/Triggers/AbstractTrigger.php
+++ b/app/TransactionRules/Triggers/AbstractTrigger.php
@@ -32,15 +32,15 @@ use FireflyIII\Models\TransactionJournal;
*/
class AbstractTrigger
{
- /** @var bool */
+ /** @var bool Whether to stop processing after this one is checked. */
public $stopProcessing;
- /** @var string */
+ /** @var string Value to check for */
protected $checkValue;
- /** @var TransactionJournal */
+ /** @var TransactionJournal Journal to check */
protected $journal;
- /** @var RuleTrigger */
+ /** @var RuleTrigger Trigger object */
protected $trigger;
- /** @var string */
+ /** @var string Trigger value */
protected $triggerValue;
/**
@@ -53,6 +53,8 @@ class AbstractTrigger
}
/**
+ * Make a new trigger from the value given in the string.
+ *
* @codeCoverageIgnore
*
* @param string $triggerValue
@@ -70,6 +72,7 @@ class AbstractTrigger
}
/**
+ * Make a new trigger from the rule trigger in the parameter
* @codeCoverageIgnore
*
* @param RuleTrigger $trigger
@@ -87,6 +90,8 @@ class AbstractTrigger
}
/**
+ * Make a new trigger from a trigger value.
+ *
* @codeCoverageIgnore
*
* @param string $triggerValue
@@ -102,6 +107,8 @@ class AbstractTrigger
}
/**
+ * Returns trigger
+ *
* @codeCoverageIgnore
*
* @return RuleTrigger
@@ -112,6 +119,8 @@ class AbstractTrigger
}
/**
+ * Returns trigger value
+ *
* @codeCoverageIgnore
*
* @return string
diff --git a/app/TransactionRules/Triggers/AmountExactly.php b/app/TransactionRules/Triggers/AmountExactly.php
index fdc6c68391..b6f040478d 100644
--- a/app/TransactionRules/Triggers/AmountExactly.php
+++ b/app/TransactionRules/Triggers/AmountExactly.php
@@ -57,6 +57,8 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface
}
/**
+ * When the amount is exactly X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/AmountLess.php b/app/TransactionRules/Triggers/AmountLess.php
index 40a3626297..7f3538a200 100644
--- a/app/TransactionRules/Triggers/AmountLess.php
+++ b/app/TransactionRules/Triggers/AmountLess.php
@@ -57,6 +57,8 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when amount is less than X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/AmountMore.php b/app/TransactionRules/Triggers/AmountMore.php
index aa3c1591ea..5e641a8e11 100644
--- a/app/TransactionRules/Triggers/AmountMore.php
+++ b/app/TransactionRules/Triggers/AmountMore.php
@@ -63,6 +63,8 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when amount is more than X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/BudgetIs.php b/app/TransactionRules/Triggers/BudgetIs.php
index b465c76e4c..8a87c96f84 100644
--- a/app/TransactionRules/Triggers/BudgetIs.php
+++ b/app/TransactionRules/Triggers/BudgetIs.php
@@ -58,6 +58,8 @@ final class BudgetIs extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when budget is X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/CategoryIs.php b/app/TransactionRules/Triggers/CategoryIs.php
index 969ba4d062..840d93d017 100644
--- a/app/TransactionRules/Triggers/CategoryIs.php
+++ b/app/TransactionRules/Triggers/CategoryIs.php
@@ -58,6 +58,8 @@ final class CategoryIs extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when category is X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/DescriptionContains.php b/app/TransactionRules/Triggers/DescriptionContains.php
index f583f99bde..2a14eb97f0 100644
--- a/app/TransactionRules/Triggers/DescriptionContains.php
+++ b/app/TransactionRules/Triggers/DescriptionContains.php
@@ -63,6 +63,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf
}
/**
+ * Returns true when description contains X
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/DescriptionEnds.php b/app/TransactionRules/Triggers/DescriptionEnds.php
index f6a6c5f48c..36b077c7f2 100644
--- a/app/TransactionRules/Triggers/DescriptionEnds.php
+++ b/app/TransactionRules/Triggers/DescriptionEnds.php
@@ -63,6 +63,8 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when description ends with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/DescriptionIs.php b/app/TransactionRules/Triggers/DescriptionIs.php
index 77e310a30e..bce888ebfe 100644
--- a/app/TransactionRules/Triggers/DescriptionIs.php
+++ b/app/TransactionRules/Triggers/DescriptionIs.php
@@ -58,6 +58,8 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when description is X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/DescriptionStarts.php b/app/TransactionRules/Triggers/DescriptionStarts.php
index c3e123b88b..773a58e03a 100644
--- a/app/TransactionRules/Triggers/DescriptionStarts.php
+++ b/app/TransactionRules/Triggers/DescriptionStarts.php
@@ -63,6 +63,8 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac
}
/**
+ * Returns true when description starts with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/FromAccountContains.php b/app/TransactionRules/Triggers/FromAccountContains.php
index 38c1f5535c..8e265a2645 100644
--- a/app/TransactionRules/Triggers/FromAccountContains.php
+++ b/app/TransactionRules/Triggers/FromAccountContains.php
@@ -63,6 +63,8 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf
}
/**
+ * Returns true when from-account contains X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/FromAccountEnds.php b/app/TransactionRules/Triggers/FromAccountEnds.php
index 4a01a543a1..0c7818ee91 100644
--- a/app/TransactionRules/Triggers/FromAccountEnds.php
+++ b/app/TransactionRules/Triggers/FromAccountEnds.php
@@ -63,6 +63,8 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when from account ends with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/FromAccountIs.php b/app/TransactionRules/Triggers/FromAccountIs.php
index 6764ad94b0..4c8321f241 100644
--- a/app/TransactionRules/Triggers/FromAccountIs.php
+++ b/app/TransactionRules/Triggers/FromAccountIs.php
@@ -63,6 +63,8 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when from-account is X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/FromAccountStarts.php b/app/TransactionRules/Triggers/FromAccountStarts.php
index f75bc9717c..117d727273 100644
--- a/app/TransactionRules/Triggers/FromAccountStarts.php
+++ b/app/TransactionRules/Triggers/FromAccountStarts.php
@@ -63,6 +63,8 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac
}
/**
+ * Returns true when from-account starts with X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/HasAnyBudget.php b/app/TransactionRules/Triggers/HasAnyBudget.php
index c039dc006a..57d3e7b2b4 100644
--- a/app/TransactionRules/Triggers/HasAnyBudget.php
+++ b/app/TransactionRules/Triggers/HasAnyBudget.php
@@ -53,6 +53,8 @@ final class HasAnyBudget extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when transactions have any budget
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/HasAnyCategory.php b/app/TransactionRules/Triggers/HasAnyCategory.php
index 50d72ce62e..58177c6603 100644
--- a/app/TransactionRules/Triggers/HasAnyCategory.php
+++ b/app/TransactionRules/Triggers/HasAnyCategory.php
@@ -53,6 +53,8 @@ final class HasAnyCategory extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when journal has any category
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/HasAnyTag.php b/app/TransactionRules/Triggers/HasAnyTag.php
index abac39866f..bbc07bdcdc 100644
--- a/app/TransactionRules/Triggers/HasAnyTag.php
+++ b/app/TransactionRules/Triggers/HasAnyTag.php
@@ -52,6 +52,8 @@ final class HasAnyTag extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when journal has any tag
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/HasAttachment.php b/app/TransactionRules/Triggers/HasAttachment.php
index 2e7eaad91b..b9381cd82f 100644
--- a/app/TransactionRules/Triggers/HasAttachment.php
+++ b/app/TransactionRules/Triggers/HasAttachment.php
@@ -25,6 +25,9 @@ namespace FireflyIII\TransactionRules\Triggers;
use FireflyIII\Models\TransactionJournal;
use Log;
+/**
+ * Class HasAttachment
+ */
class HasAttachment extends AbstractTrigger implements TriggerInterface
{
/**
@@ -54,6 +57,8 @@ class HasAttachment extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when journal has more than X attachments.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/HasNoBudget.php b/app/TransactionRules/Triggers/HasNoBudget.php
index 6834fd24c8..f0990f99fb 100644
--- a/app/TransactionRules/Triggers/HasNoBudget.php
+++ b/app/TransactionRules/Triggers/HasNoBudget.php
@@ -53,6 +53,7 @@ final class HasNoBudget extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when journal has no budget
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/HasNoCategory.php b/app/TransactionRules/Triggers/HasNoCategory.php
index b12072d005..03c8c18732 100644
--- a/app/TransactionRules/Triggers/HasNoCategory.php
+++ b/app/TransactionRules/Triggers/HasNoCategory.php
@@ -53,6 +53,8 @@ final class HasNoCategory extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when journal has no category
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/HasNoTag.php b/app/TransactionRules/Triggers/HasNoTag.php
index b547171450..377c2bcdd5 100644
--- a/app/TransactionRules/Triggers/HasNoTag.php
+++ b/app/TransactionRules/Triggers/HasNoTag.php
@@ -52,6 +52,8 @@ final class HasNoTag extends AbstractTrigger implements TriggerInterface
}
/**
+ * Return true when journal has no tags.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/NotesAny.php b/app/TransactionRules/Triggers/NotesAny.php
index fb63301ad7..6e9b298047 100644
--- a/app/TransactionRules/Triggers/NotesAny.php
+++ b/app/TransactionRules/Triggers/NotesAny.php
@@ -53,6 +53,8 @@ final class NotesAny extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when journal has any notes
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/NotesAre.php b/app/TransactionRules/Triggers/NotesAre.php
index 34a7fef5f6..5aea73ae2b 100644
--- a/app/TransactionRules/Triggers/NotesAre.php
+++ b/app/TransactionRules/Triggers/NotesAre.php
@@ -59,6 +59,8 @@ final class NotesAre extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when notes are specifically X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/NotesContain.php b/app/TransactionRules/Triggers/NotesContain.php
index 10f3c35d44..20a8549d56 100644
--- a/app/TransactionRules/Triggers/NotesContain.php
+++ b/app/TransactionRules/Triggers/NotesContain.php
@@ -64,6 +64,8 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when notes contains X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/NotesEmpty.php b/app/TransactionRules/Triggers/NotesEmpty.php
index dc1bedff4f..91af8d7b43 100644
--- a/app/TransactionRules/Triggers/NotesEmpty.php
+++ b/app/TransactionRules/Triggers/NotesEmpty.php
@@ -53,6 +53,8 @@ final class NotesEmpty extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when journal has no notes.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/NotesEnd.php b/app/TransactionRules/Triggers/NotesEnd.php
index 8c36fcb659..5ed37b9a04 100644
--- a/app/TransactionRules/Triggers/NotesEnd.php
+++ b/app/TransactionRules/Triggers/NotesEnd.php
@@ -64,6 +64,7 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when notes end with X
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/NotesStart.php b/app/TransactionRules/Triggers/NotesStart.php
index eedea6f71e..31bc0b43b1 100644
--- a/app/TransactionRules/Triggers/NotesStart.php
+++ b/app/TransactionRules/Triggers/NotesStart.php
@@ -64,6 +64,8 @@ final class NotesStart extends AbstractTrigger implements TriggerInterface
}
/**
+ * When the notes start with X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/TagIs.php b/app/TransactionRules/Triggers/TagIs.php
index 3f4fcb19f1..de0b952de1 100644
--- a/app/TransactionRules/Triggers/TagIs.php
+++ b/app/TransactionRules/Triggers/TagIs.php
@@ -58,6 +58,8 @@ final class TagIs extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when tag is X.
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/ToAccountContains.php b/app/TransactionRules/Triggers/ToAccountContains.php
index cd4141c826..e73f575a75 100644
--- a/app/TransactionRules/Triggers/ToAccountContains.php
+++ b/app/TransactionRules/Triggers/ToAccountContains.php
@@ -63,6 +63,8 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac
}
/**
+ * Returns true when to-account contains X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/ToAccountEnds.php b/app/TransactionRules/Triggers/ToAccountEnds.php
index ba2a4f0d30..ab623133c8 100644
--- a/app/TransactionRules/Triggers/ToAccountEnds.php
+++ b/app/TransactionRules/Triggers/ToAccountEnds.php
@@ -63,6 +63,8 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when to-account ends with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/ToAccountIs.php b/app/TransactionRules/Triggers/ToAccountIs.php
index 50a20375c0..ab224ff5a0 100644
--- a/app/TransactionRules/Triggers/ToAccountIs.php
+++ b/app/TransactionRules/Triggers/ToAccountIs.php
@@ -63,6 +63,7 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when to-account is X.
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/ToAccountStarts.php b/app/TransactionRules/Triggers/ToAccountStarts.php
index 3c47e2cdae..38b18bcd2a 100644
--- a/app/TransactionRules/Triggers/ToAccountStarts.php
+++ b/app/TransactionRules/Triggers/ToAccountStarts.php
@@ -63,6 +63,8 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface
}
/**
+ * Returns true when to-account starts with X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/TransactionType.php b/app/TransactionRules/Triggers/TransactionType.php
index 3e29c00c4d..0b15a440e1 100644
--- a/app/TransactionRules/Triggers/TransactionType.php
+++ b/app/TransactionRules/Triggers/TransactionType.php
@@ -57,6 +57,8 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface
}
/**
+ * Return true when transaction type is X
+ *
* @param TransactionJournal $journal
*
* @return bool
diff --git a/app/TransactionRules/Triggers/TriggerInterface.php b/app/TransactionRules/Triggers/TriggerInterface.php
index 7b3efa89b1..63c2b57af6 100644
--- a/app/TransactionRules/Triggers/TriggerInterface.php
+++ b/app/TransactionRules/Triggers/TriggerInterface.php
@@ -48,6 +48,8 @@ interface TriggerInterface
public static function willMatchEverything($value = null);
/**
+ * Triggers on a value and journal.
+ *
* @param TransactionJournal $journal
*
* @return bool