mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-05 20:10:57 +00:00
Some generic code refactoring.
This commit is contained in:
@@ -67,7 +67,7 @@ class ConfigureMappingHandler implements FileConfigurationInterface
|
||||
$specifics = $config['specifics'] ?? [];
|
||||
$names = array_keys($specifics);
|
||||
foreach ($names as $name) {
|
||||
if (!\in_array($name, $validSpecifics, true)) {
|
||||
if (!in_array($name, $validSpecifics, true)) {
|
||||
continue;
|
||||
}
|
||||
$class = config(sprintf('csv.import_specifics.%s', $name));
|
||||
@@ -331,7 +331,7 @@ class ConfigureMappingHandler implements FileConfigurationInterface
|
||||
{
|
||||
/** @var array $validColumns */
|
||||
$validColumns = array_keys(config('csv.import_roles'));
|
||||
if (!\in_array($name, $validColumns, true)) {
|
||||
if (!in_array($name, $validColumns, true)) {
|
||||
$name = '_ignore';
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,7 @@ class ConfigureRolesHandler implements FileConfigurationInterface
|
||||
if ('_ignore' !== $role) {
|
||||
++$assigned;
|
||||
}
|
||||
if (\in_array($role, ['amount', 'amount_credit', 'amount_debit', 'amount_negated'])) {
|
||||
if (in_array($role, ['amount', 'amount_credit', 'amount_debit', 'amount_negated'])) {
|
||||
$hasAmount = true;
|
||||
}
|
||||
if ('foreign-currency-code' === $role) {
|
||||
@@ -372,7 +372,7 @@ class ConfigureRolesHandler implements FileConfigurationInterface
|
||||
$specifics = $config['specifics'] ?? [];
|
||||
$names = array_keys($specifics);
|
||||
foreach ($names as $name) {
|
||||
if (!\in_array($name, $validSpecifics, true)) {
|
||||
if (!in_array($name, $validSpecifics, true)) {
|
||||
continue;
|
||||
}
|
||||
/** @var SpecificInterface $specific */
|
||||
|
Reference in New Issue
Block a user