Various bugfixes and code clean up.

This commit is contained in:
James Cole
2018-07-27 04:46:21 +02:00
parent 2ad8e7f343
commit 0312ba8ad7
60 changed files with 223 additions and 353 deletions

View File

@@ -161,7 +161,7 @@ class BillRepository implements BillRepositoryInterface
$set = $set->sortBy(
function (Bill $bill) {
$int = 1 === $bill->active ? 0 : 1;
$int = $bill->active ? 0 : 1;
return $int . strtolower($bill->name);
}

View File

@@ -144,11 +144,12 @@ class ExportJobRepository implements ExportJobRepositoryInterface
{
$disk = Storage::disk('export');
$file = $job->key . '.zip';
$content = '';
try {
$content = $disk->get($file);
} catch (FileNotFoundException $e) {
Log::warning(sprintf('File not found: %s', $e->getMessage()));
$content = '';
}
return $content;

View File

@@ -150,12 +150,7 @@ class ImportJobRepository implements ImportJobRepositoryInterface
*/
public function getConfiguration(ImportJob $job): array
{
$config = $job->configuration;
if (\is_array($config)) {
return $config;
}
return [];
return $job->configuration;
}
/**

View File

@@ -477,7 +477,6 @@ class JournalRepository implements JournalRepositoryInterface
$value = $entry->data;
// return when array:
if (\is_array($value)) {
$return = implode(',', $value);
$cache->store($return);

View File

@@ -379,7 +379,7 @@ class RecurringRepository implements RecurringRepositoryInterface
$repDate = Carbon::createFromFormat('Y-m-d', $repetition->repetition_moment);
$diffInYears = $today->diffInYears($repDate);
$repDate->addYears($diffInYears); // technically not necessary.
$string = $repDate->formatLocalized(trans('config.month_and_day_no_year'));
$string = $repDate->formatLocalized((string)trans('config.month_and_day_no_year'));
return (string)trans('firefly.recurring_yearly', ['date' => $string], $language);
}