Some array_keys fixes.

This commit is contained in:
James Cole 2016-09-25 08:46:42 +02:00
parent 0d198193db
commit 9a53d8c21c
3 changed files with 4 additions and 3 deletions

View File

@ -424,7 +424,8 @@ class ImportController extends Controller
$type = strtolower($job->file_type);
// validate type:
$validTypes = array_keys('firefly.import_formats');
$validTypes = array_keys(config('firefly.import_formats'));
if (in_array($type, $validTypes)) {
/** @var SetupInterface $importer */

View File

@ -123,7 +123,7 @@ class CsvImporter implements ImporterInterface
// find the role for this column:
$role = $config['column-roles'][$rowIndex] ?? '_ignore';
$doMap = $config['column-do-mapping'][$rowIndex] ?? false;
$validConverters = array_keys('csv.import_roles');
$validConverters = array_keys(config('csv.import_roles'));
// throw error when not a valid converter.
if (!in_array($role, $validConverters)) {

View File

@ -361,7 +361,7 @@ class CsvSetup implements SetupInterface
$reader = Reader::createFromString($content);
$reader->setDelimiter($config['delimiter']);
$results = $reader->fetch();
$validSpecifics = array_keys('csv.import_specifics');
$validSpecifics = array_keys(config('csv.import_specifics'));
foreach ($results as $rowIndex => $row) {