mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Various code clean up.
This commit is contained in:
@@ -134,7 +134,8 @@ class Initial implements ConfigurationInterface
|
||||
{
|
||||
// loop specifics.
|
||||
if (isset($data['specifics']) && is_array($data['specifics'])) {
|
||||
foreach ($data['specifics'] as $name => $enabled) {
|
||||
$names = array_keys($data['specifics']);
|
||||
foreach ($names as $name) {
|
||||
// verify their content.
|
||||
$className = sprintf('FireflyIII\Import\Specifics\%s', $name);
|
||||
if (class_exists($className)) {
|
||||
|
@@ -90,10 +90,12 @@ class Map implements ConfigurationInterface
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($this->data as $index => $entry) {
|
||||
$setIndexes = array_keys($this->data);
|
||||
foreach ($setIndexes as $index) {
|
||||
$this->data[$index]['values'] = array_unique($this->data[$index]['values']);
|
||||
asort($this->data[$index]['values']);
|
||||
}
|
||||
unset($setIndexes);
|
||||
|
||||
// save number of rows, thus number of steps, in job:
|
||||
$steps = $rowIndex * 5;
|
||||
@@ -233,8 +235,8 @@ class Map implements ConfigurationInterface
|
||||
{
|
||||
// run specifics here:
|
||||
// and this is the point where the specifix go to work.
|
||||
foreach ($this->configuration['specifics'] as $name => $enabled) {
|
||||
|
||||
$names = array_keys($this->configuration['specifics']);
|
||||
foreach ($names as $name) {
|
||||
if (!in_array($name, $this->validSpecifics)) {
|
||||
throw new FireflyException(sprintf('"%s" is not a valid class name', $name));
|
||||
}
|
||||
|
@@ -228,7 +228,8 @@ class Roles implements ConfigurationInterface
|
||||
*/
|
||||
private function processSpecifics(array $row): array
|
||||
{
|
||||
foreach ($this->job->configuration['specifics'] as $name => $enabled) {
|
||||
$names = array_keys($this->configuration['specifics']);
|
||||
foreach ($names as $name) {
|
||||
/** @var SpecificInterface $specific */
|
||||
$specific = app('FireflyIII\Import\Specifics\\' . $name);
|
||||
$row = $specific->run($row);
|
||||
|
Reference in New Issue
Block a user