mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-24 04:01:27 +00:00
Various code cleanup.
This commit is contained in:
@@ -51,6 +51,7 @@ class ClearNotes implements ActionInterface
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function act(TransactionJournal $journal): bool
|
||||
|
||||
@@ -67,6 +67,7 @@ class RemoveTag implements ActionInterface
|
||||
Log::debug(sprintf('RuleAction RemoveTag removed tag #%d ("%s") from journal #%d.', $tag->id, $tag->tag, $journal->id));
|
||||
$journal->tags()->detach([$tag->id]);
|
||||
$journal->touch();
|
||||
|
||||
return true;
|
||||
}
|
||||
Log::debug(sprintf('RuleAction RemoveTag tried to remove tag "%s" from journal #%d but no such tag exists.', $name, $journal->id));
|
||||
|
||||
@@ -89,6 +89,7 @@ class SetBudget implements ActionInterface
|
||||
|
||||
$journal->budgets()->sync([$budget->id]);
|
||||
$journal->touch();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ class SetDescription implements ActionInterface
|
||||
private $action;
|
||||
|
||||
/**
|
||||
*
|
||||
* TriggerInterface constructor.
|
||||
*
|
||||
* @param RuleAction $action
|
||||
|
||||
@@ -59,6 +59,7 @@ class SetDestinationAccount implements ActionInterface
|
||||
|
||||
/**
|
||||
* Set destination account to X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* 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;
|
||||
@@ -42,7 +41,7 @@ class SetSourceAccount implements ActionInterface
|
||||
/** @var TransactionJournal The journal */
|
||||
private $journal;
|
||||
|
||||
/** @var Account The new source account*/
|
||||
/** @var Account The new source account */
|
||||
private $newSourceAccount;
|
||||
|
||||
/** @var AccountRepositoryInterface Account repository */
|
||||
|
||||
@@ -47,6 +47,7 @@ class ActionFactory
|
||||
* @param RuleAction $action
|
||||
*
|
||||
* @return ActionInterface
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public static function getAction(RuleAction $action): ActionInterface
|
||||
|
||||
@@ -49,6 +49,7 @@ class TriggerFactory
|
||||
* @param RuleTrigger $trigger
|
||||
*
|
||||
* @return AbstractTrigger
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public static function getTrigger(RuleTrigger $trigger)
|
||||
|
||||
@@ -45,7 +45,7 @@ final class Processor
|
||||
public $journal;
|
||||
/** @var Rule Rule that applies */
|
||||
public $rule;
|
||||
/** @var Collection All triggers*/
|
||||
/** @var Collection All triggers */
|
||||
public $triggers;
|
||||
/** @var int Found triggers */
|
||||
private $foundTriggers = 0;
|
||||
@@ -95,6 +95,7 @@ final class Processor
|
||||
* @param string $triggerValue
|
||||
*
|
||||
* @return Processor
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public static function makeFromString(string $triggerName, string $triggerValue)
|
||||
@@ -119,6 +120,7 @@ final class Processor
|
||||
* @param array $triggers
|
||||
*
|
||||
* @return Processor
|
||||
*
|
||||
* @throws \FireflyIII\Exceptions\FireflyException
|
||||
*/
|
||||
public static function makeFromStringArray(array $triggers)
|
||||
|
||||
@@ -109,6 +109,7 @@ class TransactionMatcher
|
||||
|
||||
/**
|
||||
* Return limit
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getLimit(): int
|
||||
@@ -132,6 +133,7 @@ class TransactionMatcher
|
||||
|
||||
/**
|
||||
* Get range
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getRange(): int
|
||||
@@ -155,6 +157,7 @@ class TransactionMatcher
|
||||
|
||||
/**
|
||||
* Get triggers
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getTriggers(): array
|
||||
|
||||
@@ -73,6 +73,7 @@ class AbstractTrigger
|
||||
|
||||
/**
|
||||
* Make a new trigger from the rule trigger in the parameter
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*
|
||||
* @param RuleTrigger $trigger
|
||||
|
||||
@@ -64,6 +64,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf
|
||||
|
||||
/**
|
||||
* Returns true when description contains X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
||||
@@ -54,6 +54,7 @@ final class HasNoBudget extends AbstractTrigger implements TriggerInterface
|
||||
|
||||
/**
|
||||
* Returns true when journal has no budget
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
||||
@@ -65,6 +65,7 @@ final class NotesEnd extends AbstractTrigger implements TriggerInterface
|
||||
|
||||
/**
|
||||
* Returns true when notes end with X
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
||||
@@ -64,6 +64,7 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface
|
||||
|
||||
/**
|
||||
* Returns true when to-account is X.
|
||||
*
|
||||
* @param TransactionJournal $journal
|
||||
*
|
||||
* @return bool
|
||||
|
||||
Reference in New Issue
Block a user