First code for YNAB import #145

This commit is contained in:
James Cole
2018-07-29 07:30:06 +02:00
parent a1005d91df
commit 8efbeb14d2
16 changed files with 627 additions and 13 deletions

View File

@@ -54,21 +54,18 @@ class ImportProvider implements BinderInterface
foreach ($providerNames as $providerName) {
// only consider enabled providers
$enabled = (bool)config(sprintf('import.enabled.%s', $providerName));
$allowedForDemo = (bool)config(sprintf('import.allowed_for_demo.%s', $providerName));
$allowedForUser = (bool)config(sprintf('import.allowed_for_user.%s', $providerName));
if (false === $enabled) {
continue;
}
if (true === $isDemoUser && false === $allowedForDemo) {
continue;
}
if (false === $isDemoUser && false === $allowedForUser && false === $isDebug) {
continue; // @codeCoverageIgnore
}
$providers[$providerName] = [
'has_prereq' => (bool)config('import.has_prereq.' . $providerName),
'has_prereq' => (bool)config('import.has_prereq.' . $providerName),
'allowed_for_demo' => (bool)config(sprintf('import.allowed_for_demo.%s', $providerName)),
];
$class = (string)config(sprintf('import.prerequisites.%s', $providerName));
$result = false;