Add php doc blocks.

This commit is contained in:
James Cole
2017-11-25 15:20:53 +01:00
parent f7b1168e7c
commit 35647a062c
66 changed files with 235 additions and 84 deletions

View File

@@ -35,6 +35,8 @@ use Swift_TransportException;
class AdminEventHandler class AdminEventHandler
{ {
/** /**
* Sends a test message to an administrator.
*
* @param AdminRequestedTestMessage $event * @param AdminRequestedTestMessage $event
* *
* @return bool * @return bool

View File

@@ -45,6 +45,7 @@ use View;
/** /**
* Class ReconcileController. * Class ReconcileController.
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/ */
class ReconcileController extends Controller class ReconcileController extends Controller
{ {
@@ -100,7 +101,7 @@ class ReconcileController extends Controller
return view( return view(
'accounts.reconcile.edit', 'accounts.reconcile.edit',
compact('journal', 'optionalFields', 'assetAccounts', 'what', 'budgetList', 'subTitle') compact('journal', 'subTitle')
)->with('data', $preFilled); )->with('data', $preFilled);
} }
@@ -136,8 +137,6 @@ class ReconcileController extends Controller
/** @var Transaction $transaction */ /** @var Transaction $transaction */
foreach ($transactions as $transaction) { foreach ($transactions as $transaction) {
// {% if transaction.date > end %}
$amount = bcadd($amount, $transaction->amount); $amount = bcadd($amount, $transaction->amount);
} }
@@ -148,24 +147,12 @@ class ReconcileController extends Controller
++$countCleared; ++$countCleared;
} }
} }
// final difference:
//{% set diff = (startBalance - endBalance) + clearedAmount + amount %}
$difference = bcadd(bcadd(bcsub($startBalance, $endBalance), $clearedAmount), $amount); $difference = bcadd(bcadd(bcsub($startBalance, $endBalance), $clearedAmount), $amount);
$diffCompare = bccomp($difference, '0'); $diffCompare = bccomp($difference, '0');
$return = [ $return = [
'is_zero' => false,
'post_uri' => $route, '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); return Response::json($return);
} }
@@ -175,7 +162,7 @@ class ReconcileController extends Controller
* @param Carbon|null $start * @param Carbon|null $start
* @param Carbon|null $end * @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) 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%']); $overviewUri = route('accounts.reconcile.overview', [$account->id, '%start%', '%end%']);
$indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']); $indexUri = route('accounts.reconcile', [$account->id, '%start%', '%end%']);
return view( return view('accounts.reconcile.index', compact('account', 'currency', 'subTitleIcon', 'start', 'end', 'subTitle', 'startBalance', 'endBalance', 'transactionsUri', 'overviewUri', 'indexUri'));
'accounts.reconcile.index',
compact(
'account',
'currency',
'subTitleIcon',
'start',
'end',
'subTitle',
'startBalance',
'endBalance',
'transactionsUri',
'selectionStart',
'selectionEnd',
'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) public function show(JournalRepositoryInterface $repository, TransactionJournal $journal)
{ {
@@ -257,9 +230,12 @@ class ReconcileController extends Controller
} }
/** /**
* @param Request $request
* @param Account $account * @param Account $account
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
*
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/ */
public function submit(Request $request, Account $account, Carbon $start, Carbon $end) public function submit(Request $request, Account $account, Carbon $start, Carbon $end)
{ {

View File

@@ -1,7 +1,4 @@
<?php <?php
declare(strict_types=1);
/** /**
* AdminTestMail.php * AdminTestMail.php
* Copyright (c) 2017 thegrumpydictator@gmail.com * Copyright (c) 2017 thegrumpydictator@gmail.com
@@ -22,6 +19,9 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Mail; namespace FireflyIII\Mail;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
@@ -30,14 +30,16 @@ use Illuminate\Queue\SerializesModels;
/** /**
* Class AdminTestMail. * Class AdminTestMail.
*
* Sends a test mail to administrators.
*/ */
class AdminTestMail extends Mailable class AdminTestMail extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
/** @var string */ /** @var string Email address of admin */
public $email; public $email;
/** @var string */ /** @var string IP address of admin */
public $ipAddress; public $ipAddress;
/** /**

View File

@@ -1,7 +1,4 @@
<?php <?php
declare(strict_types=1);
/** /**
* ConfirmEmailChangeMail.php * ConfirmEmailChangeMail.php
* Copyright (c) 2017 thegrumpydictator@gmail.com * Copyright (c) 2017 thegrumpydictator@gmail.com
@@ -22,23 +19,30 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Mail; namespace FireflyIII\Mail;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable; use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/**
* Class ConfirmEmailChangeMail
*
* Sends message to new address to confirm change.
*/
class ConfirmEmailChangeMail extends Mailable class ConfirmEmailChangeMail extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
/** @var string */ /** @var string IP address of user */
public $ipAddress; public $ipAddress;
/** @var string */ /** @var string New email address */
public $newEmail; public $newEmail;
/** @var string */ /** @var string Old email address */
public $oldEmail; public $oldEmail;
/** @var string */ /** @var string Confirmation link */
public $uri; public $uri;
/** /**

View File

@@ -36,12 +36,17 @@ use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable; use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/**
* Sends newly registered user an email message.
*
* Class RegisteredUser
*/
class RegisteredUser extends Mailable class RegisteredUser extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
/** @var string */ /** @var string Email address of user */
public $address; public $address;
/** @var string */ /** @var string IP address of user */
public $ipAddress; public $ipAddress;
/** /**

View File

@@ -36,12 +36,16 @@ use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable; use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/**
* Sends user link for new password.
* Class RequestedNewPassword
*/
class RequestedNewPassword extends Mailable class RequestedNewPassword extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
/** @var string */ /** @var string IP address of user */
public $ipAddress; public $ipAddress;
/** @var string */ /** @var string URI of password change link */
public $url; public $url;
/** /**

View File

@@ -1,7 +1,4 @@
<?php <?php
declare(strict_types=1);
/** /**
* UndoEmailChangeMail.php * UndoEmailChangeMail.php
* Copyright (c) 2017 thegrumpydictator@gmail.com * Copyright (c) 2017 thegrumpydictator@gmail.com
@@ -22,23 +19,30 @@ declare(strict_types=1);
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1);
namespace FireflyIII\Mail; namespace FireflyIII\Mail;
use Illuminate\Bus\Queueable; use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable; use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels; use Illuminate\Queue\SerializesModels;
/**
* Class UndoEmailChangeMail
*/
class UndoEmailChangeMail extends Mailable class UndoEmailChangeMail extends Mailable
{ {
use Queueable, SerializesModels; use Queueable, SerializesModels;
/** @var string */ /** @var string IP address of user*/
public $ipAddress; public $ipAddress;
/** @var string */ /** @var string New email address */
public $newEmail; public $newEmail;
/** @var string */ /** @var string Old email address */
public $oldEmail; public $oldEmail;
/** @var string */ /** @var string URI to undo */
public $uri; public $uri;
/** /**

View File

@@ -51,7 +51,7 @@ class AccountServiceProvider extends ServiceProvider
} }
/** /**
* * Register account repository
*/ */
private function registerRepository() private function registerRepository()
{ {

View File

@@ -45,7 +45,7 @@ class AdminServiceProvider extends ServiceProvider
} }
/** /**
* * Register link type repository
*/ */
private function linkType() private function linkType()
{ {

View File

@@ -33,6 +33,9 @@ namespace FireflyIII\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
/**
* Class AuthServiceProvider
*/
class AuthServiceProvider extends ServiceProvider class AuthServiceProvider extends ServiceProvider
{ {
/** /**

View File

@@ -18,6 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\Repositories\Journal; namespace FireflyIII\Repositories\Journal;

View File

@@ -38,6 +38,8 @@ interface ActionInterface
public function __construct(RuleAction $action); public function __construct(RuleAction $action);
/** /**
* Execute the action.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -32,7 +32,7 @@ use Log;
*/ */
class AddTag implements ActionInterface class AddTag implements ActionInterface
{ {
/** @var RuleAction */ /** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -46,6 +46,8 @@ class AddTag implements ActionInterface
} }
/** /**
* Add a tag
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -31,6 +31,7 @@ use Log;
*/ */
class AppendDescription implements ActionInterface class AppendDescription implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -44,6 +45,8 @@ class AppendDescription implements ActionInterface
} }
/** /**
* Append description with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -32,6 +32,7 @@ use Log;
*/ */
class AppendNotes implements ActionInterface class AppendNotes implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -45,6 +46,8 @@ class AppendNotes implements ActionInterface
} }
/** /**
* Append notes with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -31,6 +31,7 @@ use Log;
*/ */
class ClearBudget implements ActionInterface class ClearBudget implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -44,6 +45,8 @@ class ClearBudget implements ActionInterface
} }
/** /**
* Clear all budgets
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -31,6 +31,7 @@ use Log;
*/ */
class ClearCategory implements ActionInterface class ClearCategory implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -44,6 +45,8 @@ class ClearCategory implements ActionInterface
} }
/** /**
* Clear all categories
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -32,6 +32,7 @@ use Log;
*/ */
class ClearNotes implements ActionInterface class ClearNotes implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -45,6 +46,8 @@ class ClearNotes implements ActionInterface
} }
/** /**
* Remove notes
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -31,6 +31,7 @@ use Log;
*/ */
class PrependDescription implements ActionInterface class PrependDescription implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -44,6 +45,8 @@ class PrependDescription implements ActionInterface
} }
/** /**
* Prepend description with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -32,6 +32,7 @@ use Log;
*/ */
class PrependNotes implements ActionInterface class PrependNotes implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -45,6 +46,8 @@ class PrependNotes implements ActionInterface
} }
/** /**
* Prepend notes with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -31,6 +31,7 @@ use Log;
*/ */
class RemoveAllTags implements ActionInterface class RemoveAllTags implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -44,6 +45,8 @@ class RemoveAllTags implements ActionInterface
} }
/** /**
* Remove all tags
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -32,6 +32,7 @@ use Log;
*/ */
class RemoveTag implements ActionInterface class RemoveTag implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -45,6 +46,8 @@ class RemoveTag implements ActionInterface
} }
/** /**
* Remove tag X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -34,6 +34,7 @@ use Log;
*/ */
class SetBudget implements ActionInterface class SetBudget implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -47,6 +48,8 @@ class SetBudget implements ActionInterface
} }
/** /**
* Set budget X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -32,6 +32,7 @@ use Log;
*/ */
class SetCategory implements ActionInterface class SetCategory implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -45,6 +46,8 @@ class SetCategory implements ActionInterface
} }
/** /**
* Set category X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -31,9 +31,11 @@ use Log;
*/ */
class SetDescription implements ActionInterface class SetDescription implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
*
* TriggerInterface constructor. * TriggerInterface constructor.
* *
* @param RuleAction $action * @param RuleAction $action
@@ -44,6 +46,8 @@ class SetDescription implements ActionInterface
} }
/** /**
* Set description to X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -35,15 +35,16 @@ use Log;
*/ */
class SetDestinationAccount implements ActionInterface class SetDestinationAccount implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** @var TransactionJournal */ /** @var TransactionJournal The journal */
private $journal; private $journal;
/** @var Account */ /** @var Account The new account */
private $newDestinationAccount; private $newDestinationAccount;
/** @var AccountRepositoryInterface */ /** @var AccountRepositoryInterface Account repository */
private $repository; private $repository;
/** /**
@@ -57,6 +58,7 @@ class SetDestinationAccount implements ActionInterface
} }
/** /**
* Set destination account to X
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -18,6 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions; namespace FireflyIII\TransactionRules\Actions;
@@ -32,6 +33,7 @@ use Log;
*/ */
class SetNotes implements ActionInterface class SetNotes implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** /**
@@ -45,6 +47,8 @@ class SetNotes implements ActionInterface
} }
/** /**
* Set notes to X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -18,6 +18,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>. * along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/ */
declare(strict_types=1); declare(strict_types=1);
namespace FireflyIII\TransactionRules\Actions; namespace FireflyIII\TransactionRules\Actions;
@@ -35,15 +36,16 @@ use Log;
*/ */
class SetSourceAccount implements ActionInterface class SetSourceAccount implements ActionInterface
{ {
/** @var RuleAction The rule action */
private $action; private $action;
/** @var TransactionJournal */ /** @var TransactionJournal The journal */
private $journal; private $journal;
/** @var Account */ /** @var Account The new source account*/
private $newSourceAccount; private $newSourceAccount;
/** @var AccountRepositoryInterface */ /** @var AccountRepositoryInterface Account repository */
private $repository; private $repository;
/** /**
@@ -57,6 +59,8 @@ class SetSourceAccount implements ActionInterface
} }
/** /**
* Set source account to X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -30,10 +30,12 @@ use Log;
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore
* Class ActionFactory *
* Class ActionFactory can create actions.
*/ */
class ActionFactory class ActionFactory
{ {
/** @var array array of action types */
protected static $actionTypes = []; protected static $actionTypes = [];
/** /**

View File

@@ -31,10 +31,12 @@ use Log;
/** /**
* @codeCoverageIgnore * @codeCoverageIgnore
* Interface TriggerInterface *
* Class TriggerFactory can create triggers.
*/ */
class TriggerFactory class TriggerFactory
{ {
/** @var array array with trigger types */
protected static $triggerTypes = []; protected static $triggerTypes = [];
/** /**

View File

@@ -39,15 +39,15 @@ use Log;
*/ */
final class Processor final class Processor
{ {
/** @var Collection */ /** @var Collection Actions to exectute */
public $actions; public $actions;
/** @var TransactionJournal */ /** @var TransactionJournal Journal to run them on */
public $journal; public $journal;
/** @var Rule */ /** @var Rule Rule that applies */
public $rule; public $rule;
/** @var Collection */ /** @var Collection All triggers*/
public $triggers; public $triggers;
/** @var int */ /** @var int Found triggers */
private $foundTriggers = 0; private $foundTriggers = 0;
/** /**
@@ -132,6 +132,8 @@ final class Processor
} }
/** /**
* Return found triggers
*
* @return int * @return int
*/ */
public function getFoundTriggers(): int public function getFoundTriggers(): int
@@ -140,6 +142,8 @@ final class Processor
} }
/** /**
* Set found triggers
*
* @param int $foundTriggers * @param int $foundTriggers
*/ */
public function setFoundTriggers(int $foundTriggers) public function setFoundTriggers(int $foundTriggers)
@@ -148,6 +152,8 @@ final class Processor
} }
/** /**
* Returns the rule
*
* @return \FireflyIII\Models\Rule * @return \FireflyIII\Models\Rule
*/ */
public function getRule(): Rule public function getRule(): Rule
@@ -216,6 +222,8 @@ final class Processor
} }
/** /**
* Run the actions
*
* @return bool * @return bool
*/ */
private function actions() private function actions()

View File

@@ -36,15 +36,15 @@ use Log;
*/ */
class TransactionMatcher class TransactionMatcher
{ {
/** @var int */ /** @var int Limit of matcher */
private $limit = 10; private $limit = 10;
/** @var int Maximum number of transaction to search in (for performance reasons) * */ /** @var int Maximum number of transaction to search in (for performance reasons) * */
private $range = 200; private $range = 200;
/** @var Rule */ /** @var Rule The rule to apply */
private $rule; private $rule;
/** @var JournalTaskerInterface */ /** @var JournalTaskerInterface Tasker for some related tasks */
private $tasker; private $tasker;
/** @var array */ /** @var array Types that can be matched using this matcher */
private $transactionTypes = [TransactionType::DEPOSIT, TransactionType::WITHDRAWAL, TransactionType::TRANSFER]; private $transactionTypes = [TransactionType::DEPOSIT, TransactionType::WITHDRAWAL, TransactionType::TRANSFER];
/** @var array List of triggers to match */ /** @var array List of triggers to match */
private $triggers = []; private $triggers = [];
@@ -108,6 +108,7 @@ class TransactionMatcher
} }
/** /**
* Return limit
* @return int * @return int
*/ */
public function getLimit(): int public function getLimit(): int
@@ -116,6 +117,8 @@ class TransactionMatcher
} }
/** /**
* Set limit
*
* @param int $limit * @param int $limit
* *
* @return TransactionMatcher * @return TransactionMatcher
@@ -128,6 +131,7 @@ class TransactionMatcher
} }
/** /**
* Get range
* @return int * @return int
*/ */
public function getRange(): int public function getRange(): int
@@ -136,6 +140,8 @@ class TransactionMatcher
} }
/** /**
* Set range
*
* @param int $range * @param int $range
* *
* @return TransactionMatcher * @return TransactionMatcher
@@ -148,6 +154,7 @@ class TransactionMatcher
} }
/** /**
* Get triggers
* @return array * @return array
*/ */
public function getTriggers(): array public function getTriggers(): array
@@ -156,6 +163,8 @@ class TransactionMatcher
} }
/** /**
* Set triggers
*
* @param array $triggers * @param array $triggers
* *
* @return TransactionMatcher * @return TransactionMatcher
@@ -168,6 +177,8 @@ class TransactionMatcher
} }
/** /**
* Set rule
*
* @param Rule $rule * @param Rule $rule
*/ */
public function setRule(Rule $rule) public function setRule(Rule $rule)
@@ -176,6 +187,8 @@ class TransactionMatcher
} }
/** /**
* Run the processor.
*
* @param Processor $processor * @param Processor $processor
* *
* @return Collection * @return Collection

View File

@@ -32,15 +32,15 @@ use FireflyIII\Models\TransactionJournal;
*/ */
class AbstractTrigger class AbstractTrigger
{ {
/** @var bool */ /** @var bool Whether to stop processing after this one is checked. */
public $stopProcessing; public $stopProcessing;
/** @var string */ /** @var string Value to check for */
protected $checkValue; protected $checkValue;
/** @var TransactionJournal */ /** @var TransactionJournal Journal to check */
protected $journal; protected $journal;
/** @var RuleTrigger */ /** @var RuleTrigger Trigger object */
protected $trigger; protected $trigger;
/** @var string */ /** @var string Trigger value */
protected $triggerValue; protected $triggerValue;
/** /**
@@ -53,6 +53,8 @@ class AbstractTrigger
} }
/** /**
* Make a new trigger from the value given in the string.
*
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @param string $triggerValue * @param string $triggerValue
@@ -70,6 +72,7 @@ class AbstractTrigger
} }
/** /**
* Make a new trigger from the rule trigger in the parameter
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @param RuleTrigger $trigger * @param RuleTrigger $trigger
@@ -87,6 +90,8 @@ class AbstractTrigger
} }
/** /**
* Make a new trigger from a trigger value.
*
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @param string $triggerValue * @param string $triggerValue
@@ -102,6 +107,8 @@ class AbstractTrigger
} }
/** /**
* Returns trigger
*
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @return RuleTrigger * @return RuleTrigger
@@ -112,6 +119,8 @@ class AbstractTrigger
} }
/** /**
* Returns trigger value
*
* @codeCoverageIgnore * @codeCoverageIgnore
* *
* @return string * @return string

View File

@@ -57,6 +57,8 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface
} }
/** /**
* When the amount is exactly X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -57,6 +57,8 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when amount is less than X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when amount is more than X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -58,6 +58,8 @@ final class BudgetIs extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when budget is X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -58,6 +58,8 @@ final class CategoryIs extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when category is X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf
} }
/** /**
* Returns true when description contains X
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when description ends with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -58,6 +58,8 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when description is X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac
} }
/** /**
* Returns true when description starts with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf
} }
/** /**
* Returns true when from-account contains X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when from account ends with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when from-account is X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac
} }
/** /**
* Returns true when from-account starts with X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -53,6 +53,8 @@ final class HasAnyBudget extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when transactions have any budget
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -53,6 +53,8 @@ final class HasAnyCategory extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when journal has any category
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -52,6 +52,8 @@ final class HasAnyTag extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when journal has any tag
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -25,6 +25,9 @@ namespace FireflyIII\TransactionRules\Triggers;
use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionJournal;
use Log; use Log;
/**
* Class HasAttachment
*/
class HasAttachment extends AbstractTrigger implements TriggerInterface 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 * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -53,6 +53,7 @@ final class HasNoBudget extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when journal has no budget
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -53,6 +53,8 @@ final class HasNoCategory extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when journal has no category
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -52,6 +52,8 @@ final class HasNoTag extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Return true when journal has no tags.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -53,6 +53,8 @@ final class NotesAny extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when journal has any notes
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -59,6 +59,8 @@ final class NotesAre extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when notes are specifically X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -64,6 +64,8 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when notes contains X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -53,6 +53,8 @@ final class NotesEmpty extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when journal has no notes.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -64,6 +64,7 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when notes end with X
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -64,6 +64,8 @@ final class NotesStart extends AbstractTrigger implements TriggerInterface
} }
/** /**
* When the notes start with X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -58,6 +58,8 @@ final class TagIs extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when tag is X.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac
} }
/** /**
* Returns true when to-account contains X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when to-account ends with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,7 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when to-account is X.
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -63,6 +63,8 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Returns true when to-account starts with X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -57,6 +57,8 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface
} }
/** /**
* Return true when transaction type is X
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool

View File

@@ -48,6 +48,8 @@ interface TriggerInterface
public static function willMatchEverything($value = null); public static function willMatchEverything($value = null);
/** /**
* Triggers on a value and journal.
*
* @param TransactionJournal $journal * @param TransactionJournal $journal
* *
* @return bool * @return bool