Files
firefly-iii/app/Rules/Triggers/UserAction.php

67 lines
1.3 KiB
PHP
Raw Normal View History

2016-01-13 07:47:26 +01:00
<?php
2016-02-05 12:08:25 +01:00
declare(strict_types = 1);
2016-01-13 07:47:26 +01:00
/**
* UserAction.php
* Copyright (C) 2016 Sander Dorigo
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace FireflyIII\Rules\Triggers;
use FireflyIII\Models\RuleTrigger;
use FireflyIII\Models\TransactionJournal;
use Log;
/**
* Class UserAction
*
* @package FireflyIII\Rules\Triggers
*/
class UserAction implements TriggerInterface
{
/** @var TransactionJournal */
protected $journal;
2016-02-17 15:38:21 +01:00
/** @var RuleTrigger */
protected $trigger;
2016-01-13 07:47:26 +01:00
/**
* TriggerInterface constructor.
*
* @param RuleTrigger $trigger
* @param TransactionJournal $journal
*/
public function __construct(RuleTrigger $trigger, TransactionJournal $journal)
{
$this->trigger = $trigger;
$this->journal = $journal;
}
/**
2016-02-17 15:38:21 +01:00
* @{inheritdoc}
*
* @see TriggerInterface::matchesAnything
2016-01-13 07:47:26 +01:00
*
* @return bool
*/
2016-02-17 15:38:21 +01:00
public function matchesAnything()
2016-01-13 07:47:26 +01:00
{
return true;
}
/**
2016-02-17 15:38:21 +01:00
* This trigger is always triggered, because the rule that it is a part of has been pre-selected on this condition.
2016-02-17 15:29:26 +01:00
*
* @return bool
*/
2016-02-17 15:38:21 +01:00
public function triggered()
2016-02-17 15:29:26 +01:00
{
2016-02-17 15:38:21 +01:00
Log::debug('user_action always returns true.');
2016-02-17 15:29:26 +01:00
return true;
}
}