mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add php doc blocks.
This commit is contained in:
parent
f7b1168e7c
commit
35647a062c
@ -35,6 +35,8 @@ use Swift_TransportException;
|
||||
class AdminEventHandler
|
||||
{
|
||||
/**
|
||||
* Sends a test message to an administrator.
|
||||
*
|
||||
* @param AdminRequestedTestMessage $event
|
||||
*
|
||||
* @return bool
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* AdminTestMail.php
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* ConfirmEmailChangeMail.php
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -1,7 +1,4 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* UndoEmailChangeMail.php
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
|
@ -51,7 +51,7 @@ class AccountServiceProvider extends ServiceProvider
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Register account repository
|
||||
*/
|
||||
private function registerRepository()
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ class AdminServiceProvider extends ServiceProvider
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Register link type repository
|
||||
*/
|
||||
private function linkType()
|
||||
{
|
||||
|
@ -33,6 +33,9 @@ namespace FireflyIII\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
/**
|
||||
* Class AuthServiceProvider
|
||||
*/
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
|
@ -18,6 +18,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Repositories\Journal;
|
||||
|
@ -38,6 +38,8 @@ interface ActionInterface
|
||||
public function __construct(RuleAction $action);
|
||||
|
||||
/**
|
||||
* Execute the action.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -18,6 +18,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
@ -18,6 +18,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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
|
||||
|
@ -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 = [];
|
||||
|
||||
/**
|
||||
|
@ -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 = [];
|
||||
|
||||
/**
|
||||
|
@ -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()
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -57,6 +57,8 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* When the amount is exactly X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -57,6 +57,8 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when amount is less than X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when amount is more than X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -58,6 +58,8 @@ final class BudgetIs extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when budget is X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -58,6 +58,8 @@ final class CategoryIs extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when category is X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when description contains X
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when description ends with X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -58,6 +58,8 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when description is X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when description starts with X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when from-account contains X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when from account ends with X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when from-account is X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when from-account starts with X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -53,6 +53,8 @@ final class HasAnyBudget extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when transactions have any budget
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -53,6 +53,8 @@ final class HasAnyCategory extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when journal has any category
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -52,6 +52,8 @@ final class HasAnyTag extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when journal has any tag
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -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
|
||||
|
@ -53,6 +53,7 @@ final class HasNoBudget extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when journal has no budget
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -53,6 +53,8 @@ final class HasNoCategory extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when journal has no category
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -52,6 +52,8 @@ final class HasNoTag extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true when journal has no tags.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -53,6 +53,8 @@ final class NotesAny extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when journal has any notes
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -59,6 +59,8 @@ final class NotesAre extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when notes are specifically X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -64,6 +64,8 @@ final class NotesContain extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when notes contains X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -53,6 +53,8 @@ final class NotesEmpty extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when journal has no notes.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -64,6 +64,7 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when notes end with X
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -64,6 +64,8 @@ final class NotesStart extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* When the notes start with X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -58,6 +58,8 @@ final class TagIs extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when tag is X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when to-account contains X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when to-account ends with X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,7 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when to-account is X.
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -63,6 +63,8 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true when to-account starts with X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -57,6 +57,8 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true when transaction type is X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
@ -48,6 +48,8 @@ interface TriggerInterface
|
||||
public static function willMatchEverything($value = null);
|
||||
|
||||
/**
|
||||
* Triggers on a value and journal.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
Loading…
Reference in New Issue
Block a user