mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Update more code.
This commit is contained in:
@@ -30,13 +30,8 @@ namespace FireflyIII\Support\Search\QueryParser;
|
|||||||
*/
|
*/
|
||||||
class FieldNode extends Node
|
class FieldNode extends Node
|
||||||
{
|
{
|
||||||
private string $operator;
|
public function __construct(private readonly string $operator, private readonly string $value, bool $prohibited = false)
|
||||||
private string $value;
|
|
||||||
|
|
||||||
public function __construct(string $operator, string $value, bool $prohibited = false)
|
|
||||||
{
|
{
|
||||||
$this->operator = $operator;
|
|
||||||
$this->value = $value;
|
|
||||||
$this->prohibited = $prohibited;
|
$this->prohibited = $prohibited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,7 +33,7 @@ use Illuminate\Support\Facades\Log;
|
|||||||
|
|
||||||
class GdbotsQueryParser implements QueryParserInterface
|
class GdbotsQueryParser implements QueryParserInterface
|
||||||
{
|
{
|
||||||
private BaseQueryParser $parser;
|
private readonly BaseQueryParser $parser;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@@ -98,7 +98,7 @@ class GdbotsQueryParser implements QueryParserInterface
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
throw new FireflyException(
|
throw new FireflyException(
|
||||||
sprintf('Unsupported node type: %s', get_class($node))
|
sprintf('Unsupported node type: %s', $node::class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -32,15 +32,11 @@ namespace FireflyIII\Support\Search\QueryParser;
|
|||||||
*/
|
*/
|
||||||
class NodeGroup extends Node
|
class NodeGroup extends Node
|
||||||
{
|
{
|
||||||
/** @var Node[] */
|
|
||||||
private array $nodes;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Node[] $nodes
|
* @param Node[] $nodes
|
||||||
*/
|
*/
|
||||||
public function __construct(array $nodes, bool $prohibited = false)
|
public function __construct(private readonly array $nodes, bool $prohibited = false)
|
||||||
{
|
{
|
||||||
$this->nodes = $nodes;
|
|
||||||
$this->prohibited = $prohibited;
|
$this->prohibited = $prohibited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,11 +30,8 @@ namespace FireflyIII\Support\Search\QueryParser;
|
|||||||
*/
|
*/
|
||||||
class StringNode extends Node
|
class StringNode extends Node
|
||||||
{
|
{
|
||||||
private string $value;
|
public function __construct(private readonly string $value, bool $prohibited = false)
|
||||||
|
|
||||||
public function __construct(string $value, bool $prohibited = false)
|
|
||||||
{
|
{
|
||||||
$this->value = $value;
|
|
||||||
$this->prohibited = $prohibited;
|
$this->prohibited = $prohibited;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ trait GeneratesInstallationId
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$config = app('fireflyconfig')->get('installation_id');
|
$config = app('fireflyconfig')->get('installation_id');
|
||||||
} catch (FireflyException $e) {
|
} catch (FireflyException) {
|
||||||
app('log')->info('Could not create or generate installation ID. Do not continue.');
|
app('log')->info('Could not create or generate installation ID. Do not continue.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@@ -37,6 +37,7 @@ use Twig\TwigFunction;
|
|||||||
*/
|
*/
|
||||||
class AmountFormat extends AbstractExtension
|
class AmountFormat extends AbstractExtension
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function getFilters(): array
|
public function getFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -71,6 +72,7 @@ class AmountFormat extends AbstractExtension
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFunctions(): array
|
public function getFunctions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -43,6 +43,7 @@ use Twig\TwigFunction;
|
|||||||
*/
|
*/
|
||||||
class General extends AbstractExtension
|
class General extends AbstractExtension
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function getFilters(): array
|
public function getFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -74,7 +75,7 @@ class General extends AbstractExtension
|
|||||||
$default = Amount::getNativeCurrency();
|
$default = Amount::getNativeCurrency();
|
||||||
$convertToNative = Amount::convertToNative();
|
$convertToNative = Amount::convertToNative();
|
||||||
$useNative = $convertToNative && $default->id !== $currency->id;
|
$useNative = $convertToNative && $default->id !== $currency->id;
|
||||||
$currency = null === $currency ? $default : $currency;
|
$currency ??= $default;
|
||||||
$strings = [];
|
$strings = [];
|
||||||
foreach ($info as $key => $balance) {
|
foreach ($info as $key => $balance) {
|
||||||
if ('balance' === $key) {
|
if ('balance' === $key) {
|
||||||
@@ -137,77 +138,15 @@ class General extends AbstractExtension
|
|||||||
{
|
{
|
||||||
return new TwigFilter(
|
return new TwigFilter(
|
||||||
'mimeIcon',
|
'mimeIcon',
|
||||||
static function (string $string): string {
|
static fn(string $string): string => match ($string) {
|
||||||
switch ($string) {
|
'application/pdf' => 'fa-file-pdf-o',
|
||||||
default:
|
'image/png', 'image/jpeg', 'image/svg+xml', 'image/heic', 'image/heic-sequence', 'application/vnd.oasis.opendocument.image' => 'fa-file-image-o',
|
||||||
return 'fa-file-o';
|
'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'application/x-iwork-pages-sffpages', 'application/vnd.sun.xml.writer', 'application/vnd.sun.xml.writer.template', 'application/vnd.sun.xml.writer.global', 'application/vnd.stardivision.writer', 'application/vnd.stardivision.writer-global', 'application/vnd.oasis.opendocument.text', 'application/vnd.oasis.opendocument.text-template', 'application/vnd.oasis.opendocument.text-web', 'application/vnd.oasis.opendocument.text-master' => 'fa-file-word-o',
|
||||||
|
'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'application/vnd.sun.xml.calc', 'application/vnd.sun.xml.calc.template', 'application/vnd.stardivision.calc', 'application/vnd.oasis.opendocument.spreadsheet', 'application/vnd.oasis.opendocument.spreadsheet-template' => 'fa-file-excel-o',
|
||||||
case 'application/pdf':
|
'application/vnd.ms-powerpoint', 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'application/vnd.openxmlformats-officedocument.presentationml.template', 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'application/vnd.sun.xml.impress', 'application/vnd.sun.xml.impress.template', 'application/vnd.stardivision.impress', 'application/vnd.oasis.opendocument.presentation', 'application/vnd.oasis.opendocument.presentation-template' => 'fa-file-powerpoint-o',
|
||||||
return 'fa-file-pdf-o';
|
'application/vnd.sun.xml.draw', 'application/vnd.sun.xml.draw.template', 'application/vnd.stardivision.draw', 'application/vnd.oasis.opendocument.chart' => 'fa-paint-brush',
|
||||||
|
'application/vnd.oasis.opendocument.graphics', 'application/vnd.oasis.opendocument.graphics-template', 'application/vnd.sun.xml.math', 'application/vnd.stardivision.math', 'application/vnd.oasis.opendocument.formula', 'application/vnd.oasis.opendocument.database' => 'fa-calculator',
|
||||||
// image
|
default => 'fa-file-o',
|
||||||
case 'image/png':
|
|
||||||
case 'image/jpeg':
|
|
||||||
case 'image/svg+xml':
|
|
||||||
case 'image/heic':
|
|
||||||
case 'image/heic-sequence':
|
|
||||||
case 'application/vnd.oasis.opendocument.image':
|
|
||||||
return 'fa-file-image-o';
|
|
||||||
|
|
||||||
// MS word
|
|
||||||
case 'application/msword':
|
|
||||||
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
|
|
||||||
case 'application/vnd.openxmlformats-officedocument.wordprocessingml.template':
|
|
||||||
case 'application/x-iwork-pages-sffpages':
|
|
||||||
case 'application/vnd.sun.xml.writer':
|
|
||||||
case 'application/vnd.sun.xml.writer.template':
|
|
||||||
case 'application/vnd.sun.xml.writer.global':
|
|
||||||
case 'application/vnd.stardivision.writer':
|
|
||||||
case 'application/vnd.stardivision.writer-global':
|
|
||||||
case 'application/vnd.oasis.opendocument.text':
|
|
||||||
case 'application/vnd.oasis.opendocument.text-template':
|
|
||||||
case 'application/vnd.oasis.opendocument.text-web':
|
|
||||||
case 'application/vnd.oasis.opendocument.text-master':
|
|
||||||
return 'fa-file-word-o';
|
|
||||||
|
|
||||||
// MS excel
|
|
||||||
case 'application/vnd.ms-excel':
|
|
||||||
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
|
|
||||||
case 'application/vnd.openxmlformats-officedocument.spreadsheetml.template':
|
|
||||||
case 'application/vnd.sun.xml.calc':
|
|
||||||
case 'application/vnd.sun.xml.calc.template':
|
|
||||||
case 'application/vnd.stardivision.calc':
|
|
||||||
case 'application/vnd.oasis.opendocument.spreadsheet':
|
|
||||||
case 'application/vnd.oasis.opendocument.spreadsheet-template':
|
|
||||||
return 'fa-file-excel-o';
|
|
||||||
|
|
||||||
// MS powerpoint
|
|
||||||
case 'application/vnd.ms-powerpoint':
|
|
||||||
case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
|
|
||||||
case 'application/vnd.openxmlformats-officedocument.presentationml.template':
|
|
||||||
case 'application/vnd.openxmlformats-officedocument.presentationml.slideshow':
|
|
||||||
case 'application/vnd.sun.xml.impress':
|
|
||||||
case 'application/vnd.sun.xml.impress.template':
|
|
||||||
case 'application/vnd.stardivision.impress':
|
|
||||||
case 'application/vnd.oasis.opendocument.presentation':
|
|
||||||
case 'application/vnd.oasis.opendocument.presentation-template':
|
|
||||||
return 'fa-file-powerpoint-o';
|
|
||||||
|
|
||||||
// calc
|
|
||||||
case 'application/vnd.sun.xml.draw':
|
|
||||||
case 'application/vnd.sun.xml.draw.template':
|
|
||||||
case 'application/vnd.stardivision.draw':
|
|
||||||
case 'application/vnd.oasis.opendocument.chart':
|
|
||||||
return 'fa-paint-brush';
|
|
||||||
|
|
||||||
case 'application/vnd.oasis.opendocument.graphics':
|
|
||||||
case 'application/vnd.oasis.opendocument.graphics-template':
|
|
||||||
case 'application/vnd.sun.xml.math':
|
|
||||||
case 'application/vnd.stardivision.math':
|
|
||||||
case 'application/vnd.oasis.opendocument.formula':
|
|
||||||
case 'application/vnd.oasis.opendocument.database':
|
|
||||||
return 'fa-calculator';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
['is_safe' => ['html']]
|
['is_safe' => ['html']]
|
||||||
);
|
);
|
||||||
@@ -248,6 +187,7 @@ class General extends AbstractExtension
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFunctions(): array
|
public function getFunctions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -271,9 +211,7 @@ class General extends AbstractExtension
|
|||||||
{
|
{
|
||||||
return new TwigFunction(
|
return new TwigFunction(
|
||||||
'phpdate',
|
'phpdate',
|
||||||
static function (string $str): string {
|
static fn(string $str): string => \Safe\date($str)
|
||||||
return \Safe\date($str);
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -333,8 +271,8 @@ class General extends AbstractExtension
|
|||||||
|
|
||||||
if ($objectType === $activeObjectType
|
if ($objectType === $activeObjectType
|
||||||
&& false !== stripos(
|
&& false !== stripos(
|
||||||
\Route::getCurrentRoute()->getName(),
|
(string) \Route::getCurrentRoute()->getName(),
|
||||||
$route
|
(string) $route
|
||||||
)) {
|
)) {
|
||||||
return 'active';
|
return 'active';
|
||||||
}
|
}
|
||||||
@@ -435,9 +373,7 @@ class General extends AbstractExtension
|
|||||||
{
|
{
|
||||||
return new TwigFunction(
|
return new TwigFunction(
|
||||||
'carbonize',
|
'carbonize',
|
||||||
static function (string $date): Carbon {
|
static fn(string $date): Carbon => new Carbon($date, config('app.timezone'))
|
||||||
return new Carbon($date, config('app.timezone'));
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -31,6 +31,7 @@ use Twig\TwigFunction;
|
|||||||
*/
|
*/
|
||||||
class Rule extends AbstractExtension
|
class Rule extends AbstractExtension
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function getFunctions(): array
|
public function getFunctions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
@@ -44,13 +45,11 @@ class Rule extends AbstractExtension
|
|||||||
{
|
{
|
||||||
return new TwigFunction(
|
return new TwigFunction(
|
||||||
'allJournalTriggers',
|
'allJournalTriggers',
|
||||||
static function () {
|
static fn() => [
|
||||||
return [
|
|
||||||
'store-journal' => (string) trans('firefly.rule_trigger_store_journal'),
|
'store-journal' => (string) trans('firefly.rule_trigger_store_journal'),
|
||||||
'update-journal' => (string) trans('firefly.rule_trigger_update_journal'),
|
'update-journal' => (string) trans('firefly.rule_trigger_update_journal'),
|
||||||
'manual-activation' => (string) trans('firefly.rule_trigger_manual'),
|
'manual-activation' => (string) trans('firefly.rule_trigger_manual'),
|
||||||
];
|
]
|
||||||
}
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -39,6 +39,7 @@ use Twig\TwigFunction;
|
|||||||
*/
|
*/
|
||||||
class TransactionGroupTwig extends AbstractExtension
|
class TransactionGroupTwig extends AbstractExtension
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function getFunctions(): array
|
public function getFunctions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -32,19 +32,19 @@ use Twig\TwigFunction;
|
|||||||
*/
|
*/
|
||||||
class Translation extends AbstractExtension
|
class Translation extends AbstractExtension
|
||||||
{
|
{
|
||||||
|
#[\Override]
|
||||||
public function getFilters(): array
|
public function getFilters(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
new TwigFilter(
|
new TwigFilter(
|
||||||
'_',
|
'_',
|
||||||
static function ($name) {
|
static fn($name) => (string) trans(sprintf('firefly.%s', $name)),
|
||||||
return (string) trans(sprintf('firefly.%s', $name));
|
|
||||||
},
|
|
||||||
['is_safe' => ['html']]
|
['is_safe' => ['html']]
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[\Override]
|
||||||
public function getFunctions(): array
|
public function getFunctions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
@@ -36,14 +36,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class AddTag implements ActionInterface
|
class AddTag implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -37,14 +37,11 @@ class AppendDescription implements ActionInterface
|
|||||||
{
|
{
|
||||||
use RefreshNotesTrait;
|
use RefreshNotesTrait;
|
||||||
|
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -39,14 +39,11 @@ class AppendDescriptionToNotes implements ActionInterface
|
|||||||
{
|
{
|
||||||
use RefreshNotesTrait;
|
use RefreshNotesTrait;
|
||||||
|
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -37,14 +37,11 @@ class AppendNotes implements ActionInterface
|
|||||||
{
|
{
|
||||||
use RefreshNotesTrait;
|
use RefreshNotesTrait;
|
||||||
|
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -41,14 +41,11 @@ class AppendNotesToDescription implements ActionInterface
|
|||||||
use ConvertsDataTypes;
|
use ConvertsDataTypes;
|
||||||
use RefreshNotesTrait;
|
use RefreshNotesTrait;
|
||||||
|
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -34,14 +34,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class ClearBudget implements ActionInterface
|
class ClearBudget implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -34,14 +34,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class ClearCategory implements ActionInterface
|
class ClearCategory implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -35,14 +35,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class ClearNotes implements ActionInterface
|
class ClearNotes implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -43,14 +43,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class ConvertToDeposit implements ActionInterface
|
class ConvertToDeposit implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -42,14 +42,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class ConvertToTransfer implements ActionInterface
|
class ConvertToTransfer implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -43,14 +43,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class ConvertToWithdrawal implements ActionInterface
|
class ConvertToWithdrawal implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -35,14 +35,11 @@ use FireflyIII\Services\Internal\Destroy\TransactionGroupDestroyService;
|
|||||||
*/
|
*/
|
||||||
class DeleteTransaction implements ActionInterface
|
class DeleteTransaction implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -37,14 +37,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class LinkToBill implements ActionInterface
|
class LinkToBill implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -36,14 +36,11 @@ use FireflyIII\Models\TransactionJournal;
|
|||||||
*/
|
*/
|
||||||
class MoveDescriptionToNotes implements ActionInterface
|
class MoveDescriptionToNotes implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -42,14 +42,11 @@ class MoveNotesToDescription implements ActionInterface
|
|||||||
{
|
{
|
||||||
use ConvertsDataTypes;
|
use ConvertsDataTypes;
|
||||||
|
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -34,14 +34,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class PrependDescription implements ActionInterface
|
class PrependDescription implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -34,14 +34,11 @@ use FireflyIII\Models\TransactionJournal;
|
|||||||
*/
|
*/
|
||||||
class PrependNotes implements ActionInterface
|
class PrependNotes implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -34,14 +34,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class RemoveAllTags implements ActionInterface
|
class RemoveAllTags implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -35,14 +35,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class RemoveTag implements ActionInterface
|
class RemoveTag implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -35,14 +35,11 @@ class SetAmount implements ActionInterface
|
|||||||
{
|
{
|
||||||
use RefreshNotesTrait;
|
use RefreshNotesTrait;
|
||||||
|
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -36,14 +36,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class SetBudget implements ActionInterface
|
class SetBudget implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -36,14 +36,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class SetCategory implements ActionInterface
|
class SetCategory implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -36,14 +36,11 @@ class SetDescription implements ActionInterface
|
|||||||
{
|
{
|
||||||
use RefreshNotesTrait;
|
use RefreshNotesTrait;
|
||||||
|
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -39,15 +39,13 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class SetDestinationAccount implements ActionInterface
|
class SetDestinationAccount implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
private AccountRepositoryInterface $repository;
|
private AccountRepositoryInterface $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -39,14 +39,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class SetDestinationToCashAccount implements ActionInterface
|
class SetDestinationToCashAccount implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -33,14 +33,11 @@ use FireflyIII\Models\TransactionJournal;
|
|||||||
*/
|
*/
|
||||||
class SetNotes implements ActionInterface
|
class SetNotes implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -39,15 +39,13 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class SetSourceAccount implements ActionInterface
|
class SetSourceAccount implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
private AccountRepositoryInterface $repository;
|
private AccountRepositoryInterface $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -39,14 +39,11 @@ use Illuminate\Support\Facades\DB;
|
|||||||
*/
|
*/
|
||||||
class SetSourceToCashAccount implements ActionInterface
|
class SetSourceToCashAccount implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -36,14 +36,11 @@ use FireflyIII\Models\TransactionJournal;
|
|||||||
*/
|
*/
|
||||||
class SwitchAccounts implements ActionInterface
|
class SwitchAccounts implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -37,14 +37,11 @@ use Illuminate\Support\Facades\Log;
|
|||||||
|
|
||||||
class UpdatePiggyBank implements ActionInterface
|
class UpdatePiggyBank implements ActionInterface
|
||||||
{
|
{
|
||||||
private RuleAction $action;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerInterface constructor.
|
* TriggerInterface constructor.
|
||||||
*/
|
*/
|
||||||
public function __construct(RuleAction $action)
|
public function __construct(private readonly RuleAction $action)
|
||||||
{
|
{
|
||||||
$this->action = $action;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actOnArray(array $journal): bool
|
public function actOnArray(array $journal): bool
|
||||||
|
@@ -44,11 +44,11 @@ use Illuminate\Support\Facades\Log;
|
|||||||
*/
|
*/
|
||||||
class SearchRuleEngine implements RuleEngineInterface
|
class SearchRuleEngine implements RuleEngineInterface
|
||||||
{
|
{
|
||||||
private Collection $groups;
|
private readonly Collection $groups;
|
||||||
private array $operators;
|
private array $operators;
|
||||||
private bool $refreshTriggers;
|
private bool $refreshTriggers;
|
||||||
private array $resultCount;
|
private array $resultCount;
|
||||||
private Collection $rules;
|
private readonly Collection $rules;
|
||||||
private User $user;
|
private User $user;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
|
@@ -82,17 +82,15 @@ class ActionExpression
|
|||||||
// 'destination_transaction_id',
|
// 'destination_transaction_id',
|
||||||
'notes',
|
'notes',
|
||||||
];
|
];
|
||||||
private string $expr;
|
private readonly ExpressionLanguage $expressionLanguage;
|
||||||
private ExpressionLanguage $expressionLanguage;
|
private readonly bool $isExpression;
|
||||||
private bool $isExpression;
|
private readonly ?SyntaxError $validationError;
|
||||||
private ?SyntaxError $validationError;
|
|
||||||
|
|
||||||
public function __construct(string $expr)
|
public function __construct(private readonly string $expr)
|
||||||
{
|
{
|
||||||
$this->expressionLanguage = app(ExpressionLanguage::class);
|
$this->expressionLanguage = app(ExpressionLanguage::class);
|
||||||
$this->expr = $expr;
|
|
||||||
|
|
||||||
$this->isExpression = self::isExpression($expr);
|
$this->isExpression = self::isExpression($this->expr);
|
||||||
$this->validationError = $this->validate();
|
$this->validationError = $this->validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -45,16 +45,12 @@ class ActionExpressionLanguageProvider implements ExpressionFunctionProviderInte
|
|||||||
return [
|
return [
|
||||||
new ExpressionFunction(
|
new ExpressionFunction(
|
||||||
'constant2',
|
'constant2',
|
||||||
static function ($str): string {
|
static fn($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'),
|
||||||
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!');
|
|
||||||
},
|
|
||||||
$function
|
$function
|
||||||
),
|
),
|
||||||
new ExpressionFunction(
|
new ExpressionFunction(
|
||||||
'constant',
|
'constant',
|
||||||
static function ($str): string {
|
static fn($str): string => sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!'),
|
||||||
return sprintf('(is_string(%1$s) ? strtolower(%1$s) : %1$s)', $str.'!');
|
|
||||||
},
|
|
||||||
$function
|
$function
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@ use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
|
|||||||
*/
|
*/
|
||||||
class AttachmentTransformer extends AbstractTransformer
|
class AttachmentTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private AttachmentRepositoryInterface $repository;
|
private readonly AttachmentRepositoryInterface $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BillTransformer constructor.
|
* BillTransformer constructor.
|
||||||
|
@@ -36,11 +36,11 @@ use FireflyIII\Support\Facades\Amount;
|
|||||||
*/
|
*/
|
||||||
class AvailableBudgetTransformer extends AbstractTransformer
|
class AvailableBudgetTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private NoBudgetRepositoryInterface $noBudgetRepository;
|
private readonly NoBudgetRepositoryInterface $noBudgetRepository;
|
||||||
private OperationsRepositoryInterface $opsRepository;
|
private readonly OperationsRepositoryInterface $opsRepository;
|
||||||
private BudgetRepositoryInterface $repository;
|
private readonly BudgetRepositoryInterface $repository;
|
||||||
private TransactionCurrency $default;
|
private readonly TransactionCurrency $default;
|
||||||
private bool $convertToNative;
|
private readonly bool $convertToNative;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CurrencyTransformer constructor.
|
* CurrencyTransformer constructor.
|
||||||
|
@@ -40,10 +40,10 @@ use Illuminate\Support\Collection;
|
|||||||
*/
|
*/
|
||||||
class BillTransformer extends AbstractTransformer
|
class BillTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private BillDateCalculator $calculator;
|
private readonly BillDateCalculator $calculator;
|
||||||
private BillRepositoryInterface $repository;
|
private readonly BillRepositoryInterface $repository;
|
||||||
private TransactionCurrency $default;
|
private readonly TransactionCurrency $default;
|
||||||
private bool $convertToNative;
|
private readonly bool $convertToNative;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BillTransformer constructor.
|
* BillTransformer constructor.
|
||||||
|
@@ -38,10 +38,10 @@ use Symfony\Component\HttpFoundation\ParameterBag;
|
|||||||
*/
|
*/
|
||||||
class BudgetTransformer extends AbstractTransformer
|
class BudgetTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private OperationsRepositoryInterface $opsRepository;
|
private readonly OperationsRepositoryInterface $opsRepository;
|
||||||
private BudgetRepositoryInterface $repository;
|
private readonly BudgetRepositoryInterface $repository;
|
||||||
private bool $convertToNative;
|
private readonly bool $convertToNative;
|
||||||
private TransactionCurrency $default;
|
private readonly TransactionCurrency $default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BudgetTransformer constructor.
|
* BudgetTransformer constructor.
|
||||||
|
@@ -36,10 +36,10 @@ use Illuminate\Support\Collection;
|
|||||||
*/
|
*/
|
||||||
class CategoryTransformer extends AbstractTransformer
|
class CategoryTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private OperationsRepositoryInterface $opsRepository;
|
private readonly OperationsRepositoryInterface $opsRepository;
|
||||||
private CategoryRepositoryInterface $repository;
|
private readonly CategoryRepositoryInterface $repository;
|
||||||
private TransactionCurrency $default;
|
private readonly TransactionCurrency $default;
|
||||||
private bool $convertToNative;
|
private readonly bool $convertToNative;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CategoryTransformer constructor.
|
* CategoryTransformer constructor.
|
||||||
|
@@ -34,8 +34,8 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
|||||||
*/
|
*/
|
||||||
class PiggyBankEventTransformer extends AbstractTransformer
|
class PiggyBankEventTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private PiggyBankRepositoryInterface $piggyRepos;
|
private readonly PiggyBankRepositoryInterface $piggyRepos;
|
||||||
private AccountRepositoryInterface $repository;
|
private readonly AccountRepositoryInterface $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PiggyBankEventTransformer constructor.
|
* PiggyBankEventTransformer constructor.
|
||||||
|
@@ -35,8 +35,8 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
|
|||||||
*/
|
*/
|
||||||
class PiggyBankTransformer extends AbstractTransformer
|
class PiggyBankTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private AccountRepositoryInterface $accountRepos;
|
private readonly AccountRepositoryInterface $accountRepos;
|
||||||
private PiggyBankRepositoryInterface $piggyRepos;
|
private readonly PiggyBankRepositoryInterface $piggyRepos;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PiggyBankTransformer constructor.
|
* PiggyBankTransformer constructor.
|
||||||
|
@@ -42,11 +42,11 @@ use FireflyIII\Repositories\Recurring\RecurringRepositoryInterface;
|
|||||||
*/
|
*/
|
||||||
class RecurrenceTransformer extends AbstractTransformer
|
class RecurrenceTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private BillRepositoryInterface $billRepos;
|
private readonly BillRepositoryInterface $billRepos;
|
||||||
private BudgetRepositoryInterface $budgetRepos;
|
private readonly BudgetRepositoryInterface $budgetRepos;
|
||||||
private CategoryFactory $factory;
|
private readonly CategoryFactory $factory;
|
||||||
private PiggyBankRepositoryInterface $piggyRepos;
|
private readonly PiggyBankRepositoryInterface $piggyRepos;
|
||||||
private RecurringRepositoryInterface $repository;
|
private readonly RecurringRepositoryInterface $repository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RecurrenceTransformer constructor.
|
* RecurrenceTransformer constructor.
|
||||||
|
@@ -35,7 +35,7 @@ use FireflyIII\Repositories\Rule\RuleRepositoryInterface;
|
|||||||
*/
|
*/
|
||||||
class RuleTransformer extends AbstractTransformer
|
class RuleTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private RuleRepositoryInterface $ruleRepository;
|
private readonly RuleRepositoryInterface $ruleRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CurrencyTransformer constructor.
|
* CurrencyTransformer constructor.
|
||||||
|
@@ -44,9 +44,9 @@ use Illuminate\Support\Facades\Log;
|
|||||||
*/
|
*/
|
||||||
class TransactionGroupTransformer extends AbstractTransformer
|
class TransactionGroupTransformer extends AbstractTransformer
|
||||||
{
|
{
|
||||||
private TransactionGroupRepositoryInterface $groupRepos;
|
private readonly TransactionGroupRepositoryInterface $groupRepos;
|
||||||
private array $metaDateFields;
|
private readonly array $metaDateFields;
|
||||||
private array $metaFields;
|
private readonly array $metaFields;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
@@ -325,9 +325,7 @@ class BillTransformer extends AbstractTransformer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$simple = $set->map( // @phpstan-ignore-line
|
$simple = $set->map( // @phpstan-ignore-line
|
||||||
static function (Carbon $date) {
|
static fn(Carbon $date) => $date->toAtomString()
|
||||||
return $date->toAtomString();
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return $simple->toArray();
|
return $simple->toArray();
|
||||||
|
@@ -35,7 +35,5 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
Broadcast::channel(
|
Broadcast::channel(
|
||||||
'App.User.{id}',
|
'App.User.{id}',
|
||||||
static function ($user, $id) {
|
static fn($user, $id) => (int)$user->id === (int)$id
|
||||||
return (int)$user->id === (int)$id;
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user